#48304 [Fbk->Opn]: curl_errno return 0 on error
| From: | dypa at bk dot ru | Date: | Tue, 19 May 2009 09:55:03 +0000 |
| Subject: | #48304 [Fbk->Opn]: curl_errno return 0 on error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137482@lists.php.net to get a copy of this message | ||
ID: 48304
User updated by: dypa at bk dot ru
Reported By: dypa at bk dot ru
-Status: Feedback
+Status: Open
Bug Type: cURL related
Operating System: linux
PHP Version: 5.2.9
New Comment:
user@ubuntu:/tmp$ uname -a
Linux ubuntu 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC
2009 i686 GNU/Linux
user@ubuntu:/tmp/curl-7.19.5$ ./configure
user@ubuntu:/tmp/php5.2-200905190830$ ./configure --disable-all
--with-curl
user@ubuntu:/tmp$ php -v
PHP 5.2.10-dev (cli) (built: May 19 2009 12:49:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
user@ubuntu:/tmp$ php -i
curl
cURL support => enabled
cURL Information => libcurl/7.19.5
user@ubuntu:/tmp$ php test.php
resource(4) of type (curl)
resource(5) of type (curl)
int(0)
int(0)
string(35) "Couldn't resolve host '404.php.net'"
string(0) ""
Previous Comments:
------------------------------------------------------------------------
[2009-05-18 11:39:32] dypa at bk dot ru
C:\php>php test.php
resource(4) of type (curl)
resource(5) of type (curl)
int(0)
int(0)
string(51) "Could not resolve host: 404.php.net; Host not found"
string(0) ""
C:\php>php -v
PHP 5.2.10-dev (cli) (built: May 18 2009 11:46:45)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
------------------------------------------------------------------------
[2009-05-16 23:04:23] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2009-05-16 19:27:34] knockk at mail dot ru
same problem on windows xp php 5.2.9-1
------------------------------------------------------------------------
[2009-05-16 17:07:30] dypa at bk dot ru
Description:
------------
when i use curl_multi curl_errno returns 0 on errors
see:
user@localhost:/$php code.php
this bug related to: http://bugs.php.net/bug.php?id=33570
Reproduce code:
---------------
<?php
// create both cURL resources
$ch1 = curl_init();
$ch2 = curl_init();
// set URL and other appropriate options
curl_setopt($ch1, CURLOPT_URL, "http://404.php.net");
curl_setopt($ch1, CURLOPT_HEADER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
curl_setopt($ch2, CURLOPT_HEADER, 0);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
//create the multiple cURL handle
$mh = curl_multi_init();
//add the two handles
curl_multi_add_handle($mh,$ch1);
curl_multi_add_handle($mh,$ch2);
$running=null;
//execute the handles
do {
curl_multi_exec($mh,$running);
} while ($running > 0);
var_dump($ch1);
var_dump($ch2);
var_dump(curl_errno($ch1));
var_dump(curl_errno($ch2));
var_dump(curl_error($ch1));
var_dump(curl_error($ch2));
//close the handles
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);
Expected result:
----------------
resource(4) of type (curl)
resource(5) of type (curl)
int(6) //CURLE_COULDNT_RESOLVE_HOST (6)
int(0)
string(35) "Couldn't resolve host '404.php.net'"
string(0) ""
Actual result:
--------------
resource(4) of type (curl)
resource(5) of type (curl)
int(0)
int(0)
string(35) "Couldn't resolve host '404.php.net'"
string(0) ""
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48304&edit=1