ID: 48304 Updated by: j...@php.net Reported By: dypa at bk dot ru -Status: Open +Status: Bogus Bug Type: cURL related Operating System: linux PHP Version: 5.2.9 New Comment:
Actually you should be using this: http://php.net/curl_multi_info_read The multi API is "special" and the easy API functions don't always work fine in every case. Previous Comments: ------------------------------------------------------------------------ [2009-05-19 09:55:02] dypa at bk dot ru u...@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 u...@ubuntu:/tmp/curl-7.19.5$ ./configure u...@ubuntu:/tmp/php5.2-200905190830$ ./configure --disable-all --with-curl u...@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 u...@ubuntu:/tmp$ php -i curl cURL support => enabled cURL Information => libcurl/7.19.5 u...@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) "" ------------------------------------------------------------------------ [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] j...@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: u...@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