|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-05-01 09:23 UTC] develop1983 at gmail dot com
[2012-05-01 09:26 UTC] pajoye@php.net
[2012-05-01 09:26 UTC] pajoye@php.net
-Status: Open
+Status: Feedback
[2012-05-01 10:50 UTC] develop1983 at gmail dot com
[2012-05-01 10:50 UTC] develop1983 at gmail dot com
-Status: Feedback
+Status: Open
[2012-05-03 06:09 UTC] laruence@php.net
[2012-05-03 17:17 UTC] develop1983 at gmail dot com
[2012-05-09 19:13 UTC] develop1983 at gmail dot com
[2012-09-28 17:03 UTC] pierrick@php.net
[2012-09-28 17:03 UTC] pierrick@php.net
-Status: Open
+Status: Feedback
[2012-09-29 18:23 UTC] develop1983 at gmail dot com
[2012-09-29 18:23 UTC] develop1983 at gmail dot com
-Status: Feedback
+Status: Open
[2012-09-29 23:08 UTC] pierrick@php.net
-Status: Open
+Status: Not a bug
[2012-09-29 23:08 UTC] pierrick@php.net
[2012-09-30 14:49 UTC] develop1983 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 31 23:00:01 2025 UTC |
Description: ------------ I get these warnings: Warning: (null)(): 209 is not a valid cURL handle resource in Unknown on line 0 Warning: (null)(): 211 is not a valid cURL handle resource in Unknown on line 0 After it the script stoped by "max_execution_time" (=300). Test script: --------------- // Simple script to do multiple queries // It works in PHP 5.3.9 // It doesn't work in PHP 5.3.11, 5.4.0 // I didn't tested in 5.4.1, but I think it still exists there (because it exists in PHP 5.3.11) // Requested URL is valid and I can get the content using the browser and with PHP 5.3.9 (i mean the cURL in PHP 5.3.9 package) $mh = curl_multi_init(); $ch_array = array (); // $links - Zend_Db_Table_Rowset // $link - Zend_Db_Table_Row foreach ($links as $key => $link) { $url = $link->getUrl(); $cookies = $link->getCookies(); $cookiejar = $this->_config->search->cookie->path . DS . $key; $headers = $link->getHeaders(); $ch = curl_init($url); if (substr($url, 0, 8) == 'https://') { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); } curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $link->getTimeout()); if (!file_exists($cookiejar)) { if (!empty($cookies)) { curl_setopt($ch, CURLOPT_COOKIE, $cookies); } } else { curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar); } curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar); if (!empty($headers)) { curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); } curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT_MS, $link->getTimeout()); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent_string); curl_multi_add_handle($mh, $ch); $ch_array[$key] = $ch; } do { $execReturnValue = curl_multi_exec($mh, $runningHandles); } while ($execReturnValue == CURLM_CALL_MULTI_PERFORM); while ($runningHandles && $execReturnValue == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $execReturnValue = curl_multi_exec($mh, $runningHandles); $info = curl_multi_info_read($mh); if ($info['msg'] == CURLMSG_DONE) { $ch = $info['handle']; if ($info['result'] == CURLM_OK) { // process data } else { // error } curl_multi_remove_handle($mh, $ch); curl_close($ch); } } while ($execReturnValue == CURLM_CALL_MULTI_PERFORM); } } curl_multi_close($mh);