PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Here is the error:
Warning: file_get_contents(http://site/xml_feed.php): failed to open stream: HTTP request failed! in /usr/home/public_html/test.php on line 7
It seems to work everyother time it is loaded. Is that a coincidence?
sounds like the http request is being dropped - I would say either the connection or the server on the other end is breaking down and not working right. think of file_get_contents() using an http:// request to be *JUST LIKE* hitting the same URL with a web browser - if the connection, DNS, or webserver serving the website you are requesting doesnt deliver the goods, you get an http request failed, I would say...
I never use url fopens or file_get_contents to get something from a remote machine or URL especially not with set_timeout(0)... just too many things can go wrong with that and causing your script to load up the server it runs on..... so.. I have very little experience in doing this sort of thing....