Hi everyone, When I'm doing some heavy web site updating and subsequently hitting the refresh button several times I sometimes get this error on my PHP includes where my content should be: include(http://www.prince-rupert-tourism.com/php/navmenu.php) [function.include]: failed to open stream: Connection timed out in /home/***/public_html/www/prince-rupert-tourism.com/index.php on line 86 I'm pretty sure this problem is limited to me because when I ask other people to look at my site they don't see the problem. I played with the php.ini in the quick config utility in my cpanel, played with a few values that I thought might have something to do with session timing and then reset it back to default and my site started to work normally again. I figure this has something to do with my session and me constantly reloading my site causing the buffer, bucket, kitchen sink or whatever you call it to get full and then halt. Is there a specific setting I can adjust so that I'm not running into this problem? Did you have a similar experience and how did you solve it? Cheers.
It will be your connection from the server to the other server that's causing the issue. It says what the problem was, namely that the connection timed out when trying to fetch that file
Thank you JAY6390, I also inferred that from the error message as well. I was just wondering if anyone else has had this issue and has experience in solving it. Kind of feels like the PHP server crashed, then rebooted/reset after a while... or something. Like I said,it was anything that I had a PHP include call that would not load... in fact, it held up the rest of the page from loading until I got the before mentioned error message. It happened again today and it affected every user who tried to access my sites for a couple of hours. I'm thinking it might have something to do with the shared account I am on at HostGator, and maybe I should push this issue further with the server admin, though they couldn't find anything wrong upon my initial inquiry. I'm still eager to hear you thoughts.
You could just do: file_get_contents("http://www.prince-rupert-tourism.com/php/navmenu.php"); PHP: In your situation file_get_contents is more efficient than include; (since I believe all your trying to do is retrieve remote html)
i had a similar problem but it was just too verbose code. maybe you are just overworking your server?
Hi dmanto2two, I was thinking that as well, I'm on a shared server and I'm thinking one of my neighbors might be using some heavy PHP. This is a relatively recent event, past 3 weeks, and I haven't had this problem before. I also have Hostgator support working on it and I'll let you guys know what conclusions they come to. Hi danx10, I like that code in lieu of an include! I will be checking that out. Thank you!
Problem solved, fixed and taken care of. After escalating the issue to Justin, the Linux admin at Hostgator, he informed me there is a know issue with using a "remote" address with my particular situation. This is especially common if you are using the remote include under the same domain you are trying to include the file from, thus causing the PHP server to freeze or crash. Confused yet? My domain is www.prince-rupert-tourism.com. I wrote my PHP include as such: <?php include("http://www.prince-rupert-tourism.com/php/navmenu.php"); ?> Code (markup): This code would be appropriate if I wasn't requesting the file for the same domain the include was referring to. Instead Justin told me to implement, and I did, a local address instead: <?php include("/home/***/public_html/www/prince-rupert-tourism.com/php/navmenu.php"); ?> Code (markup): The *** is in lieu of where my account name would be. This path should be pretty much the same on any Linux or Unix based server. So in the end this not only fixed my problem of my web site freezing up and not loading, this actually sped up the loading time of my page. I had a hard time finding a resolution to this issue on the net, I hope this will help others in the same situation. Cheers.