cURL in PHP5, CURLOPT_HTTPHEADER problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php5 (Ubuntu) |
Fix Released
|
Undecided
|
Soren Hansen |
Bug Description
Binary package hint: php5-curl
When using:
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$header should be an array such as:
$header = array();
$header[] = "Host: www.google.com";
$header[] = "MIME-Version: 1.0";
$header[] = "Accept: text/xml";
etc...
However it seems in Edgy only the first entity in the array is being read and the rest of the array is ignored. I have fudged a workaround in my scripts by doing:
$header = array("Host: www.google.
The best way to test this would be to send post data and force the Content-Length header along with other headers (such as mime). When doing this I get a 411 error (content-length not sent). However forcing the content-length header as above (all in a single array element) works fine.
This has been tested using php5-curl version 5.1.6-1ubuntu2 in Edgy on several x86 based CPUs
Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - the Gutsy Gibbon.
If you need a fix for the bug in previous versions of Ubuntu, please follow the instructions for "How to request new packages" at [WWW] https:/ /help.ubuntu. com/community/ UbuntuBackports #request- new-packages