This is certainly not the exact answer you are looking for however...

We had a lot of trouble using the PHP curl commands directly. We are currently doing a 
large volume of transactions using cURL with great success by 
shelling to it. I am attaching a very simple example of what we are doing below. Most 
of this code is straight out of the cURL web site.

function call_CURL($data) {

 exec("/path_to_curl/curl -m 120 -d \"$data\" https://$URL -L",$return_message_array, 

for ($i = 0; $i < count($return_message_array); $i++) {
    $results = $results.$return_message_array[$i];

return $results;


I hope this helps some.


On Thu, 20 Dec 2001 21:14:35 +0100, Roman Eich wrote:

>Hi NG,
>i want to establish an SSL connection with cURL. I used two different
>$ch = curl_init();
>curl_setopt($ch, CURLOPT_URL,"https://$URL";);
>curl_setopt($ch, CURLOPT_POST, 1);
>curl_setopt($ch, CURLOPT_POSTFIELDS , "$data");
>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>$result = curl_exec($ch);
>$x = curl_errno($ch);
>curl_close ($ch);
>and get exitcode 1
>function cURL ($URL, $options="")
>     {
>     $command="/usr/local/bin/curl";
>     $options.=" --stderr";
>     $execstring=escapeshellcmd($command." ".$URL." ".$options);
>     exec($execstring, $stdout, $errorcode);
>     $output = implode ("\n", $stdout);
>     if ($errorcode<>0) $output="";
>     return $output;
>     }
>   $options=" -d $data";
>   $data = cURL ($URL, $options);
>and get exitcode 2
>Why i get two different exitcodes and why i get in the second version
>exitcode 2?
>Can anyone help me to solve this problem?
>PHP General Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to