By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,604 Members | 858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,604 IT Pros & Developers. It's quick & easy.

fopen with URL

P: n/a
Rod
Hi,

here is my problem:
i can access from everywhere to a log file on my own web server (apache/php)
at home using a web browser:
http://myserver.com/log.txt

So my web server is okay from outside.

But, i d'ont know why, i can't open the log file from a php script with the
fopen command:
fopen("http://myserver.com/log.txt","r")

Actually, if i run the php script from my web server, it is working fine.
But if i move the script on an external web server and run it i get this
error message:
....failed to open stream: Connection timed out in ...

If i replace "myserver.com/log.txt" by anyy other web server (like
microspft.com) it is working fine!!!

Could you help me?

Why does my log file is accessible from outside using a direct acces with a
web browser(http://myserver.com/log.txt) but not running the php script
from outside??

thanks

rod
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rod wrote:
Why does my log file is accessible from outside using a direct acces
with a web browser(http://myserver.com/log.txt) but not running the
php script from outside??


Just a guess, but is your webserver behind a proxy? If so, the webbrowser
will be able to connect to the server through the proxy settings.

PHP can connect to proxies through the cURL extenstion, see
http://www.php.net/curl for more info.

Let us know the real URL when you are not behind a proxy, so we can debug
the connection and possibly suggest a solution.
JW

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.