473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CURL = Error 501

Hi,

Friend of my set up for me an apache server (Apache/2.2.0 (Fedora),
php5, mod_rewrite, etc.. - http://serwer2.profprojekt.com.pl/info.php).

Everything works just fine, but i can't send HTTP_Request with data in
POST using CURL. Server returns error:
--------------------------------------------------------------------------------------
501 Method Not Implemented

Method Not Implemented
POST to /app/webroot/cake_gateway.php not supported.
--------------------------------------------------------------------------------------

When i'm sending requests with post using forms or ajax server manages
it faultlessly...

Anyone knows where should we looking for bug ?

best
wojtek

Sep 23 '07 #1
5 5916
ko******************@gmail.com wrote:
Hi,

Friend of my set up for me an apache server (Apache/2.2.0 (Fedora),
php5, mod_rewrite, etc.. - http://serwer2.profprojekt.com.pl/info.php).

Everything works just fine, but i can't send HTTP_Request with data in
POST using CURL. Server returns error:
--------------------------------------------------------------------------------------
501 Method Not Implemented

Method Not Implemented
POST to /app/webroot/cake_gateway.php not supported.
--------------------------------------------------------------------------------------

When i'm sending requests with post using forms or ajax server manages
it faultlessly...

Anyone knows where should we looking for bug ?

best
wojtek
That's a server response code.

Are you sure you're posting to the correct page? Can you post to THAT
PAGE from a browser?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 23 '07 #2
That's a server response code.
>
Are you sure you're posting to the correct page? Can you post to THAT
PAGE from a browser?
yes, when i'm using form to post it works fine

best
wojtek

Sep 23 '07 #3
ko******************@gmail.com wrote:
>That's a server response code.

Are you sure you're posting to the correct page? Can you post to THAT
PAGE from a browser?

yes, when i'm using form to post it works fine

best
wojtek
It shouldn't be any different.

However, you didn't post any code, and my crystal ball is in the shop,
so I have no idea what your problem might be.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 23 '07 #4
It shouldn't be any different.
>
However, you didn't post any code, and my crystal ball is in the shop,
so I have no idea what your problem might be.

--
yeah, i didn't post any code, because i'm sure that code is correct -
i think that the problem is on server but i don't know where should i
be looking it, anyway here is the code:

function doCurlRequest($data)
{
//This portion taken from SabreAMF (released under LGPL)

$error = NULL;
$ch = curl_init($this->gatewayUrl);

curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_TIMEOUT,20);
curl_setopt($ch,CURLOPT_HTTPHEADER,array(AMFPHP_CO NTENT_TYPE));
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);

$result = curl_exec($ch);

if (curl_errno($ch)) {
$this->lastError = 'CURL error: ' . curl_error($ch);
return false;
} else {
curl_close($ch);
}

//Is the result valid so far?
if($result[0] != chr(0))
{
//If chr(0) is not the first char, then this result is not good
//Strip html
$this->lastError = trim(strip_tags(str_replace('<td', " <td",
$result)));
return false;
}
return $result;
}

as i say before it's AMFPHP getaway lots of people using it without
any problems. as well it's works great on my local server...

best
wojtek

Sep 23 '07 #5
ok, i've solved the problem

it was about mod_security. Replacing row with

SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-
urlencoded$|multipart/form-data;)|text/xml)"
to
SecRule REQUEST_HEADERS:Content-Type "!(?:^(?:application/x-www-form-
urlencoded$|multipart/form-data;)|text/xml|application/x-amf)"

makes it works perfectly.

thanks for your time
best
wojtek

Sep 23 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Haluk Durmus | last post by:
Hello I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php from cvs. php couse an ERROR I did the following steps:
0
by: Ville Mattila | last post by:
Hello readers, I'm trying to install the latest PHP4 version from the scratch. The configure string is following: ../configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
1
by: lists04 | last post by:
Hi, I have a problem with a curl request and running it under popen2. If I run this request from the command line: curl -i http://www.yahoo.com/test --stderr errfile (also tried redirecting...
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
1
by: c1pkw | last post by:
Hi there, I’m having a real heap of trouble with PHP and cURL My aim is to use this code (or something like it) to submit 2 fields to a remote server (using GET) and receive back 6 fields...
1
by: sik of it | last post by:
I am using windows xp. Hi, I am really new to cURL (started today) and funnily enough haven't even got it to output anything yet! Anway my problem is when using the following code I always get...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
11
by: Flexor | last post by:
I have a php script that runs from command line and makes an https request to paypal, using curl. It works fine if I run it from a web page. It fails if I run it from CLI. The error I get from...
3
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.