php curl Request Entity Too Large

Just thought I would throw this one out there.  I was currently working on a PHP 5.3+ install on my mac OSX Lion and experience the following error:

The_requested_resource does_not_allow_request_data_with_POST_requests,
_or_the_amount_of_data_provided_in the_request_exceeds_the_capacity_limit_

I did some research to find a solution, and there were a few of them out there, but nothing that was helping me.

Here’s what my cURL looked like:

$ch = curl_init($process_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$results = @curl_exec($ch);

Typically I pass in some $_POST vars, but this time I was only using $_GET query string.  So, I simply removed this line:

curl_setopt($ch, CURLOPT_POST, 1);

Then it worked!  I hope this helps someone in the future.

Luke

Lukephp curl Request Entity Too Large

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *