T-Bird Posted April 27, 2009 Share Posted April 27, 2009 I have a similar topic floating in the PHP board - for good reason. When I started off I was sure my problem was an error in my PHP configuration, as I further tested I have become convinced it is an error in my server configuration. That said, sorry if anyone is offended by my reasking. I have a file sitting on my local file server. Do to unfortunate circumstance, this is a WinXP Home box running WAMPServer2. I have opened my router/firewall. I have taken Apache off the usual port 80 and put it on port 880. Direct links to the files work fine - meaning if end-user types "MYIP:880/file.pdf" they get the file. However, when I use my remote web host (run by Network Solutions) to access the file via PHP's readfile() command, I get a connection timeout error. Similar functions like file_get_contents, fopen, and cURL all fail similarly. My web host does indeed have allow_url_fopen turned on in it's php.ini (it can use this same readfile() process for files on other machines). It seems to me the problem must be an error in the configuration of Apache on either my webhost or, in all likelyhood, my file server. I'd be willing to look into faulty access configurations in windows as well. To save space, I'm not going to reprint the diagram/explanation of my full testing here. If you feel it would help, it can be found here. Quote Link to comment https://forums.phpfreaks.com/topic/155798-error-phps-readfile-being-blocked-accidentally/ Share on other sites More sharing options...
epilator Posted June 1, 2009 Share Posted June 1, 2009 if i see correctly, you're connecting to port 880. try connecting to the standard port 80, i just tried with my networksolutions account, and i can successfully connect to port 80, but not for example to port 2222, which gives a timeout. Quote Link to comment https://forums.phpfreaks.com/topic/155798-error-phps-readfile-being-blocked-accidentally/#findComment-846978 Share on other sites More sharing options...
corbin Posted June 1, 2009 Share Posted June 1, 2009 Your hosting company probably blocks all non-80 ports on purpose. You will have to talk to them unless it's a VPS, dedicated hosting, or some other environment you control. Quote Link to comment https://forums.phpfreaks.com/topic/155798-error-phps-readfile-being-blocked-accidentally/#findComment-846986 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.