This is a discussion on fopen with URL within the PHP Language forums, part of the PHP Programming Forums category; Hi, here is my problem: i can access from everywhere to a log file on my own web server (apache/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |