ini_set('default_socket_timeout', 900); // 900 Seconds = 15 Minutes
Another way, to set a timeout, would be to use stream_context_create to set the timeout as HTTP context options of the HTTP stream wrapper in use:
$ctx = stream_context_create(array('http'=>
array(
'timeout' => 1200, // 1 200 Seconds = 20 Minutes
)
));
echo file_get_contents('http://example.com/', false, $ctx);
Reference:
http://stackoverflow.com/questions/10236166/does-file-get-contents-have-a-timeout-setting
No comments:
Post a Comment