Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何检查PHP是否支持multi_curl?_Php_Windows_Curl_Wampserver_Curl Multi - Fatal编程技术网

如何检查PHP是否支持multi_curl?

如何检查PHP是否支持multi_curl?,php,windows,curl,wampserver,curl-multi,Php,Windows,Curl,Wampserver,Curl Multi,我有一段PHP代码,它使用cURL做post请求,它使用cURL\u multi_*函数来提高性能 在我的托管PHP服务器上一切都很好 但它在我的WAMPServer 127.0.0.1上失败。单个cURL请求在WAMPServer上工作正常,但是cURL\u multi\u select()在脚本最终超时之前只返回-1 代码。。。是PHP.net手册页面上curl_multi_exec上的示例#1: 下面是导致无限循环的代码段: $active = null; do { $mrc =

我有一段PHP代码,它使用cURL做post请求,它使用cURL\u multi_*函数来提高性能

在我的托管PHP服务器上一切都很好

但它在我的WAMPServer 127.0.0.1上失败。单个cURL请求在WAMPServer上工作正常,但是
cURL\u multi\u select()
在脚本最终超时之前只返回-1

代码。。。是PHP.net手册页面上curl_multi_exec上的示例#1: 下面是导致无限循环的代码段:

$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);
    }
}
在禁用Vista防火墙的情况下进行测试

有人知道如何让curl\u multi\u*在WAMPServer上工作吗?或者有没有任何方法可以从PHP脚本中检测到对curl\u multi\u*的支持,以便我可以进行回退?

使用
函数存在('curl\u multi\u select')
来检测支持


如果您在php.ini中启用了curl,您应该很好地使用multi\u curl;
curl\u error()
有什么要说的?这个答案应该是您想要的: