This code always fails (i.e., $result
is Boolean false
):
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $path);
cu
Another way of dealing with this would be to set the CURLOPT_NOSIGNAL
option to 1 in addition to the CURLOPT_CONNECTTIMEOUT_MS
. See http://curl.haxx.se/libcurl/c/CURLOPT_NOSIGNAL.html for more info.
from: http://www.php.net/manual/en/function.curl-setopt.php
The number of milliseconds to wait while trying to connect. Use 0 to wait indefinitely. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second.