cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURL 7.8 and PHP 4.0.6

From: Thomas Deliduka <thomas_at_neweve.com>
Date: Mon, 02 Jul 2001 11:50:27 -0400

I am having trouble and I'm not sure what to do.

I don't know if this is a PHP thing or cURL. Here's the deal.

I just upgraded to PHP 4.0.6 and cURL 7.8

I followed the same procedure I did for the previous versions of these items
and had no errors.

My PHP code looks like this:

$file = fopen($filename, "w");
$ch = curl_init();

if ($ch) {
    $curl_fail = "";
    fwrite($sf, "Created Curl session for " . $orderid . " equal to $ch\n");
    if (!curl_setopt($ch, CURLOPT_URL, $posturl)) $curl_fail = "\n
CURLOPT_URL: $posturl";
    if (!curl_setopt($ch, CURLOPT_POST, 1)) $curl_fail .= "\n
CURLOPT_POST ";
    if (!curl_setopt($ch, CURLOPT_REFERER, "$referdomain")) $curl_fail .=
"\n CURLOPT_REFERER ";
    if (!curl_setopt($ch, CURLOPT_POSTFIELDS, $qs)) $curl_fail .= "\n
CURLOPT_POSTFIELDS $qs";
    if (!curl_setopt($ch, CURLOPT_FILE, $file)) $curl_fail .= "\n
CURLOPT_FILE $file";
    if (!curl_exec($ch)) $curl_fail .= "\n CURL_EXEC ";
    if ($curl_fail != "") {
        fwrite($sf, "FAILED Executed charging of card for " . $orderid . "\n
Errors: " . $curl_fail . "\n Info: " . curl_error($ch) . "\n");
        $failed = true;
        $nofile = true;
    } else {
        fwrite($sf, "Executed charging of cc for " . $orderid . "\n");
    }
    curl_close ($ch);
    fclose ($file);
} else {
    fwrite($sf, "Could not create Curl session for " . $orderid . " deal
with this!\n");
    $failed = true;
    $nofile = true;
}

My output is this:

Created Curl session for 992232600977624 equal to Resource id #7
FAILED Executed charging of card for 992232600977624
   Errors:
     CURLOPT_FILE Resource id #6
     CURL_EXEC
   Info: SSL: couldn't create a context!

So, it's failing on CURLOPT_FILE and also the execution. The error is what
you see there. "SSL: couldn't create context!"

What is this error and how can I correct it?

-- 
Thomas Deliduka
IT Manager
     -------------------------
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.com/
Received on 2001-07-02