Jump to content

Need help with file_get_contents() or possible some other issue


ultimatum

Recommended Posts

Hey guys,

 

I have a script which parses data from websites. The script is set up to read pages links from .txt file into an array and then use foreach loop to iterate through each result. I've setup exception handling in my parsing class to print the link when file_get_contents() is unable to to read data and then exit the script.

 

Issue: The script stops randomly after running for a while, it prints the link where file_get_contents() function failed but when I restart the script from that link particularly again the script works no problem until it stops again at some point. My question is: Is there a problem with a buffer?? or what could prevent file_get_contents() from executing after hundreds of iterations?

 

The error is: .... failed to open stream ... on HTTP ... - a typical error when file_get_contents() function can't read a website.

 

Your help is greatly appreaciated in advance,

 

Thank you,

 

 

ultimatum

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.