|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34180 --with-curlwrappers causes PHP to disregard some HTTP stream context options
Submitted: 2005-08-18 06:38 UTC Modified: 2006-05-25 13:10 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: ibrash at gmail dot com Assigned: pollita (profile)
Status: Closed Package: cURL related
PHP Version: 5CVS-2005-08-30 OS: *
Private report: No CVE-ID: None
 [2005-08-18 06:38 UTC] ibrash at gmail dot com
When PHP is compiled with --with-curl --with-curlwrappers, setting the HTTP method to POST in a stream context is disregarded and GET is used instead.

This affects both 5.0 and 5.1 and presumably HEAD (haven't checked).

Reproduce code:
$opts = array(
	'http' => array(
		'method' => 'POST',
		'header' => "Content-Type: application/x-www-form-urlencoded",
		'content' => 'foo=bar'

$context = stream_context_create($opts);

readfile ('', false, $context);

For reference, dumprequestinfo.php is <?php var_dump($_SERVER['REQUEST_METHOD']); print_r($_POST); ?>

Expected result:
string(4) "POST"
    [foo] => "bar"

Actual result:
string(3) "GET"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-25 13:10 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Mar 02 12:01:23 2021 UTC