file_get_contents timeout fix.

I ran into a bit of a snag when my crawler hit a server that included a straight media file. The solution for this case which caused an unhandled timeout was to simply add in a context that was created.

$context = stream_context_create(array(‘http’ => array(‘timeout’ => 1)));
file_get_contents(““, 0, $context);


  • Pandrade

    this does not work.