Jump to content

What are causes of a connection-timeout with fopen()?


Goldeneye

Recommended Posts

Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.* to 5.2.4. Not just PHP was upgraded, MySQL, postGres, and (I think) Apache were upgraded as well. Before the upgrade, my site worked perfectly.

 

But now, whenever I access my site, it takes a long time to complete a request and all that is returned is "Warning: fopen(<THE_URL>) [function.fopen]: failed to open stream: Connection timed out in..."

 

I know where the error is -- it's in my templating class. I check the remote server's configuration and the directive "allow_url_fopen is enabled and safe_mode is disabled.

 

The strange thing is that my script works on my local server perfectly which is using PHP build 5.2.5. I looked for any differences between my local-server's PHPINFO() and my remote-server's PHPINFO() and, while I didn't find anything eye-catching yet, I noticed that virtual-directory-support is disabled on my remote-server and it is enabled on my local-server. Would that be what's causing the problem? If not, what are some potential causes for fopen() to behave this way?

That does work, I might have to switch over to using that as much as I dread making all the changes through my scripts to use an absolute to point at my template files.

 

I'm still curious about why using a URL in fopen() now results in a connection-timeout, though.

It should -- in fact, it works perfectly on my local server running PHP 5.2.5. It worked on my remote server *before* it got upgraded from PHP 4.4.* to PHP 5.2.4.

 

Well I queried the PHP error in a search engine and found a few relevent results. The only other explanation I can think of (that I found from querying a search engine) is that the server got reconfigured not to allow requests to access its files via a (seemingly) remote-HTTP-request. Or perhaps even that the request is being blocked by a firewall on the remote server.

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.