fopen with URL

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/...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-16-2004
Rod
 
Posts: n/a
Default fopen with URL

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


Reply With Quote
  #2 (permalink)  
Old 12-16-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: fopen with URL

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



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0