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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.