cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Test cURL

From: <mline_at_mail.ru>
Date: Sun, 17 Apr 2005 13:25:29 +0400

Hello ALL !

On server exist cURL
  (from phpinfo - libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.4)

I'm test cURL
        $cook = "cook";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,"http://www.site.com");
        curl_setopt($ch, CURLOPT_HEADER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT,1000);
        $result = curl_exec($ch);
        curl_close($ch);

    if ($result == NULL) {
           echo "Errno : ";
           echo curl_errno($ch) ."<br>";
           echo "Error : ";
           echo curl_error($ch) ."<br>";

But answer

Errno :
Warning: curl_errno(): 1 is not a valid cURL handle resource in
/home/s/mysite.server.com/WWW/curltest.php on line 23

Error :
Warning: curl_error(): 1 is not a valid cURL handle resource in
/home/s/mysite.server.com/WWW/curltest.php on line 25

What to do ?

Regards,
  Andrew
Received on 2005-04-17