How can I set time limit on get_file_contents in PHP?

Posted by Jagira on Stack Overflow See other posts from Stack Overflow or by Jagira
Published on 2010-03-13T16:37:09Z Indexed on 2010/03/13 16:45 UTC
Read the original article Hit count: 184

Filed under:

Hello,

At times the get_file_contents takes too long and that hangs the entire script. Is there any way of setting a time out limit on get_file_contents, without modifying the maximum execution time of the script?

Edit:

Its taking long because the file does not exist. I am getting "failed to open stream: HTTP request failed!" error. But it takes forever.

© Stack Overflow or respective owner

Related posts about php