note 56445 added to function.fopen
| From: | ericw at w3consultant dot net | Date: | Fri, 02 Sep 2005 18:49:24 +0000 |
| Subject: | note 56445 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94669@lists.php.net to get a copy of this message | ||
RE: using fopen to read an http doc
I beat my head against the wall trying to figure out why i couldn't fopen("http://www.mainserver.com/mySettings.php","r");
on just 1 webserver. It was working on all the other webservers, but on this one, it would just
hang, then fail.
Finally i figured out the machine i was doing it on was unable to look up domain names!
If you are having this problem try an nslookup to the website you are having from the command line.
ie: nslookup www.yahoo.com
If that fails, the fopen will not work either.
I changed to an IP (temp solution) and it works like a charm.
-e
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56445
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56445&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56445&report=yes
Search -- http://master.php.net/manage/user-notes.php