Bug #61141 [Com]: curl_multi_select returns -1
Edit report at https://bugs.php.net/bug.php?id=61141&edit=1 ID: 61141 Comment by: bompus at gmail dot com Reported by:amoo_miki at yahoo dot com Summary:curl_multi_select returns -1 Status: Open Type: Bug Package:cURL related Operating System: Windows 7 x64 PHP Version:5.3.10 Block user comment: N Private report: N New Comment: Same exact problem and has been driving me nuts. I keep having to revert back to PHP 5.3.6 -- I have not tried 5.3.9 yet, but did try 5.3.10 and had the same issue. I am running loops with curl_multi_select and they always time out because of an infinite loop since it's always returning -1 Previous Comments: [2012-02-20 20:28:50] amoo_miki at yahoo dot com I put some debug code and got to "curl_multi_select" returning -1 no matter what, which seems to mean failure from the underlying select system call. So I guess, the conversation between Win7 x64 and cURL in 5.3.10 is not going smooth. [2012-02-20 11:42:47] amoo_miki at yahoo dot com I used these URLs just to make sure the content is small while my original code looks at various news feeds. I did make sure the URLs return stuff, via simple usage of cURL too. The timeout happens within the loop that performs the curl_multi_select. [2012-02-20 10:46:59] ras...@php.net There were no code changes between 5.3.9 and 5.3.10 that could possibly have caused this. I notice you are using php.net sites in your test script. We had some dns problems around the time you reported this. Are you sure this wasn't related to that? [2012-02-20 10:24:15] amoo_miki at yahoo dot com Description: Trying to run multiple curl calls, fails with a timeout while checking for activity. PHP 5.3.9 and before work just fine. Test script: --- http://windows.php.net/downloads/releases/md5sum.txt";); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch2, CURLOPT_URL, "http://windows.php.net/downloads/releases/sha1sum.txt";); curl_setopt($ch2, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); $mh = curl_multi_init(); curl_multi_add_handle($mh,$ch1); curl_multi_add_handle($mh,$ch2); $active = null; do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) if (curl_multi_select($mh) != -1) do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); echo strlen(curl_multi_getcontent($ch1))."-".strlen(curl_multi_getcontent($ch2)); curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?> Expected result: Seen on PHP 5.3.9: 531-1375 Actual result: -- Seen on PHP 5.3.10: Fatal error: Maximum execution time of 30 seconds exceeded in on line 15 -- Edit this bug report at https://bugs.php.net/bug.php?id=61141&edit=1
Bug #60790 [Com]: "curl_multi_select" executed first time always one second
Edit report at https://bugs.php.net/bug.php?id=60790&edit=1 ID: 60790 Comment by: bompus at gmail dot com Reported by:leonchuk at gmail dot com Summary:"curl_multi_select" executed first time always one second Status: Open Type: Bug Package:cURL related Operating System: windows (XP,7) PHP Version:5.3.9 Block user comment: N Private report: N New Comment: I've noticed this as well. The function should return as soon as it is finished I believe. This could be a CURL issue or a PHP issue. I'm interested to hear what the dev's say since I've had all kinds of issues with curl_multi_select in newer PHP versions. I keep having to revert to 5.3.6.. I've tried 5.3.10 and using curl_multi_select within a loop checking for != -1 and it causes an infinite loop since it always returns -1 on Windows 7 x64/x86, PHP 5.3.10 Previous Comments: [2012-01-18 13:18:08] leonchuk at gmail dot com Description: In Windows (tested XP and w7) function "curl_multi_select" executed first time always one second (equal to default parameter - $timeout) --- >From manual page: >http://www.php.net/function.curl-multi-init#refsect1-function.curl-multi-init-examples --- Test script: --- $ch1 = curl_init(); curl_setopt_array($ch1, array(CURLOPT_URL=>"http://lxr.php.net/";, CURLOPT_HEADER=>0, CURLOPT_RETURNTRANSFER=>1)); $mh = curl_multi_init(); curl_multi_add_handle($mh,$ch1); $active = null; do $mrc = curl_multi_exec($mh, $active); while ($mrc == CURLM_CALL_MULTI_PERFORM); $start_time = microtime(true); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { #after first run = 1 sec echo (microtime(true)-$start_time)."".PHP_EOL; do $mrc = curl_multi_exec($mh, $active); while ($mrc == CURLM_CALL_MULTI_PERFORM); } } curl_multi_remove_handle($mh, $ch1); curl_multi_close($mh); -- Edit this bug report at https://bugs.php.net/bug.php?id=60790&edit=1
Bug #61141 [Com]: curl_multi_select returns -1
Edit report at https://bugs.php.net/bug.php?id=61141&edit=1 ID: 61141 Comment by: bompus at gmail dot com Reported by:amoo_miki at yahoo dot com Summary:curl_multi_select returns -1 Status: Open Type: Bug Package:cURL related Operating System: Windows 7 x64 PHP Version:5.3.10 Block user comment: N Private report: N New Comment: I hope this helps. curl_multi_select works fine on my PHP 5.3.6 under Windows 7 x64 with the following CURL information: cURL support => enabled cURL Information => 7.21.2 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => No IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => Yes krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/1.0.0d ZLib Version => 1.2.3 libSSH Version => libssh2/1.2.7 - Under PHP 5.3.10 on Windows 7 x64, curl_multi_select is always returning -1 with the following CURL information: cURL support => enabled cURL Information => 7.24.0 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => No IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => No krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/0.9.8t ZLib Version => 1.2.5 libSSH Version => libssh2/1.3.0 I am trying to make GET requests to https:// is that helps. I noticed that there are different versions of libcurl and OpenSSL used, so it could end up being an issue with either one of those, most likely libcurl or PHP itself. Hope this helps! Previous Comments: [2012-02-28 16:52:26] bompus at gmail dot com Same exact problem and has been driving me nuts. I keep having to revert back to PHP 5.3.6 -- I have not tried 5.3.9 yet, but did try 5.3.10 and had the same issue. I am running loops with curl_multi_select and they always time out because of an infinite loop since it's always returning -1 [2012-02-20 20:28:50] amoo_miki at yahoo dot com I put some debug code and got to "curl_multi_select" returning -1 no matter what, which seems to mean failure from the underlying select system call. So I guess, the conversation between Win7 x64 and cURL in 5.3.10 is not going smooth. [2012-02-20 11:42:47] amoo_miki at yahoo dot com I used these URLs just to make sure the content is small while my original code looks at various news feeds. I did make sure the URLs return stuff, via simple usage of cURL too. The timeout happens within the loop that performs the curl_multi_select. [2012-02-20 10:46:59] ras...@php.net There were no code changes between 5.3.9 and 5.3.10 that could possibly have caused this. I notice you are using php.net sites in your test script. We had some dns problems around the time you reported this. Are you sure this wasn't related to that? [2012-02-20 10:24:15] amoo_miki at yahoo dot com Description: Trying to run multiple curl calls, fails with a timeout while checking for activity. PHP 5.3.9 and before work just fine. Test script: --- http://windows.php.net/downloads/releases/md5sum.txt";); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch2, CURLOPT_URL, "http://windows.php.net/downloads/releases/sha1sum.txt";); curl_setopt($ch2, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); $mh = curl_multi_init(); curl_multi_add_handle($mh,$ch1); curl_multi_add_handle($mh,$ch2); $active = null; do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) if (curl_multi_select($mh) != -1) do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); echo strlen(curl_multi_getcontent($ch1))."-".strlen(curl_multi_getcontent($ch2)); curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?> Expected result: Seen on PHP 5.3.9: 531-1375 Actual result: -- Seen on PHP 5.3.10: Fatal error: Maximum execution time of 30 seconds exceeded in on line 15 -- Edit this bug report at https://bugs.php.net/bug.php?id=61141&edit=1
Bug #61141 [Com]: curl_multi_select returns -1
Edit report at https://bugs.php.net/bug.php?id=61141&edit=1 ID: 61141 Comment by: bompus at gmail dot com Reported by:amoo_miki at yahoo dot com Summary:curl_multi_select returns -1 Status: Open Type: Bug Package:cURL related Operating System: Windows 7 x64 PHP Version:5.3.10 Block user comment: N Private report: N New Comment: Related to 60790 and 61240 Previous Comments: [2012-02-29 08:17:12] amoo_miki at yahoo dot com The curl details on 5.3.9 are: cURL support => enabled cURL Information => 7.21.7 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => Yes IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => Yes krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/0.9.8r ZLib Version => 1.2.5 libSSH Version => libssh2/1.2.7 meaning the changes are related to one of the following: 5.3.9 -> 5.3.10 libcURL: 7.21.7 -> 7.24.0 GSS/Negotiate: Yes -> NO SSPI:Yes -> No OpenSSL: 0.9.8r -> 0.9.8t libSSH:1.2.7 -> 1.3.0 I don't see a reason for the last 2 effecting anything. ---------------- [2012-02-28 22:09:05] bompus at gmail dot com I hope this helps. curl_multi_select works fine on my PHP 5.3.6 under Windows 7 x64 with the following CURL information: cURL support => enabled cURL Information => 7.21.2 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => No IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => Yes krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/1.0.0d ZLib Version => 1.2.3 libSSH Version => libssh2/1.2.7 - Under PHP 5.3.10 on Windows 7 x64, curl_multi_select is always returning -1 with the following CURL information: cURL support => enabled cURL Information => 7.24.0 Age => 3 Features AsynchDNS => Yes Debug => No GSS-Negotiate => No IDN => No IPv6 => Yes Largefile => Yes NTLM => Yes SPNEGO => No SSL => Yes SSPI => No krb4 => No libz => Yes CharConv => No Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp Host => i386-pc-win32 SSL Version => OpenSSL/0.9.8t ZLib Version => 1.2.5 libSSH Version => libssh2/1.3.0 I am trying to make GET requests to https:// is that helps. I noticed that there are different versions of libcurl and OpenSSL used, so it could end up being an issue with either one of those, most likely libcurl or PHP itself. Hope this helps! [2012-02-28 16:52:26] bompus at gmail dot com Same exact problem and has been driving me nuts. I keep having to revert back to PHP 5.3.6 -- I have not tried 5.3.9 yet, but did try 5.3.10 and had the same issue. I am running loops with curl_multi_select and they always time out because of an infinite loop since it's always returning -1 [2012-02-20 20:28:50] amoo_miki at yahoo dot com I put some debug code and got to "curl_multi_select" returning -1 no matter what, which seems to mean failure from the underlying select system call. So I guess, the conversation between Win7 x64 and cURL in 5.3.10 is not going smooth. [2012-02-20 11:42:47] amoo_miki at yahoo dot com I used these URLs just to make sure the content is small while my original code looks at various news feeds. I did make sure the URLs return stuff, via simple usage of cURL too. The timeout happens within the loop that performs the curl_multi_select. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61141 -- Edit this bug report at https://bugs.php.net/bug.php?id=61141&edit=1
Bug #60790 [Com]: "curl_multi_select" executed first time always one second
Edit report at https://bugs.php.net/bug.php?id=60790&edit=1 ID: 60790 Comment by: bompus at gmail dot com Reported by:leonchuk at gmail dot com Summary:"curl_multi_select" executed first time always one second Status: Open Type: Bug Package:cURL related Operating System: windows (XP,7) PHP Version:5.3.9 Block user comment: N Private report: N New Comment: Possibly related to 61141 and 61240 Previous Comments: [2012-03-24 07:28:59] qiwei dot mo at gmail dot com I have the same problem white them. Env: win7 + php5.4.0 Use the code as curl_multi-exec http://cn2.php.net/manual/zh/function.curl-multi-exec.php cause the final error: Fatal error: Maximum execution time of 30 seconds exceeded. But it be runing well in php5.3.6 In PHP5.4 , when i replace the under code --- $active = null; // æ§è¡æ¹å¤ç奿 do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } -- With do { curl_multi_exec($hMultiCurl, $iRunning); } while ($iRunning > 0); - the programe run ok So the question is the curl_multi_select bug , cause the while infinite loop. ---- [2012-02-28 17:04:37] bompus at gmail dot com I've noticed this as well. The function should return as soon as it is finished I believe. This could be a CURL issue or a PHP issue. I'm interested to hear what the dev's say since I've had all kinds of issues with curl_multi_select in newer PHP versions. I keep having to revert to 5.3.6.. I've tried 5.3.10 and using curl_multi_select within a loop checking for != -1 and it causes an infinite loop since it always returns -1 on Windows 7 x64/x86, PHP 5.3.10 [2012-01-18 13:18:08] leonchuk at gmail dot com Description: In Windows (tested XP and w7) function "curl_multi_select" executed first time always one second (equal to default parameter - $timeout) --- >From manual page: >http://www.php.net/function.curl-multi-init#refsect1-function.curl-multi-init-examples --- Test script: --- $ch1 = curl_init(); curl_setopt_array($ch1, array(CURLOPT_URL=>"http://lxr.php.net/";, CURLOPT_HEADER=>0, CURLOPT_RETURNTRANSFER=>1)); $mh = curl_multi_init(); curl_multi_add_handle($mh,$ch1); $active = null; do $mrc = curl_multi_exec($mh, $active); while ($mrc == CURLM_CALL_MULTI_PERFORM); $start_time = microtime(true); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { #after first run = 1 sec echo (microtime(true)-$start_time)."".PHP_EOL; do $mrc = curl_multi_exec($mh, $active); while ($mrc == CURLM_CALL_MULTI_PERFORM); } } curl_multi_remove_handle($mh, $ch1); curl_multi_close($mh); -- Edit this bug report at https://bugs.php.net/bug.php?id=60790&edit=1
Bug #61240 [Com]: curl_multi_select cause cpu load 100%
Edit report at https://bugs.php.net/bug.php?id=61240&edit=1 ID: 61240 Comment by: bompus at gmail dot com Reported by:niniwzw at qq dot com Summary:curl_multi_select cause cpu load 100% Status: Open Type: Bug Package:cURL related Operating System: window xp PHP Version:5.3.10 Block user comment: N Private report: N New Comment: Related to 60790 and 61141 Previous Comments: [2012-03-02 08:51:47] niniwzw at qq dot com Description: --- >From manual page: http://www.php.net/function.curl-multi-exec --- In the document of curl_multi_exec, has a example in the document. it can run in php 5.2, but php 5.3 and php 5.4 cause cpu load 100%. the example is: http://lxr.php.net/";); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/";); curl_setopt($ch2, CURLOPT_HEADER, 0); //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); $active = null; //execute the handles do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } //close the handles curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?> -- Edit this bug report at https://bugs.php.net/bug.php?id=61240&edit=1