473,513 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5925
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
2917
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
2687
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
6313
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
1855
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
8028
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
4896
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
2338
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
10082
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
3706
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
15646
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
7158
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
7380
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,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.