php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31413 cURL not posting on 64-bit machine
Submitted: 2005-01-05 01:31 UTC Modified: 2005-01-06 11:38 UTC
From: travis at etrafficsolutions dot com Assigned: jorton (profile)
Status: Closed Package: cURL related
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2005-01-05 01:31 UTC] travis at etrafficsolutions dot com
Description:
------------
CURL Information: libcurl/7.12.3 OpenSSL/0.9.7d zlib/1.2.1

Tested with PHP 4.3.10 and the latest php4 cvs.


When I run the script below on a 64-bit AMD machine, the post received by the receiving script are empty. Nothing is posted.

To try and figure out if cURL was having problems or if it was PHP, I tried the exact same submit using curl command line, to the same receiving script. Works as expected.

curl -d key=value http://{URL_HERE}/curl_receive.php

Returns a var_dump() with the key "key" holding a value of "value"

I have tested this on 3+ 32-bit machines, without any problems (script or command line curl). I have also tested on 3 64-bit machines, all of them failed when the script was run, but were successful when run from command line curl.

-------------
If I can provide any more information to help with this, please reply and I will get it to you asap.

Reproduce code:
---------------
<?php
// curl_submit.php
$ch = curl_init();
// replace {URL_HERE} to where you put this script
curl_setopt($ch, CURLOPT_URL, "http://{URL_HERE}/curl_receive.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);

$post_array = array(
        'key' => 'value');

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);

$response = curl_exec($ch);
var_dump($response);
?>

<?php
// curl_receive.php
var_dump($_POST);
?>

Expected result:
----------------
array(1) {
  ["key"]=>
  string(5) "value"
}

Actual result:
--------------
array(0) {}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-05 22:36 UTC] jorton@php.net
Can you try this patch: http://www.apache.org/~jorton/php_curl64.diff
 [2005-01-06 01:14 UTC] travis at etrafficsolutions dot com
Works!

Thanks so much for the quick response.

Any idea when this will be in CVS and when the next version (of php) will be released?

Thanks again.
 [2005-01-06 11:38 UTC] jorton@php.net
Great, thanks for testing it out.  The patch is in 4.3/5.0/5.1 CVS now, there was talk about 4.3.11 being rolled early this month.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC