RE: [PHP] remote fopen not working, despite allow_url_fopen = on
| From: | Aras | Date: | Thu, 15 Feb 2007 14:10:41 +0000 |
| Subject: | RE: [PHP] remote fopen not working, despite allow_url_fopen = on | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248899@lists.php.net to get a copy of this message | ||
Alex,
Either the domain you are trying to fetch data is unknown or your resolver
settings do not point to a regular resolving server. (check
/etc/resolv.conf)
Aras Koktas
manager@phidot.com
Business Excellence Development
Phi.dot Internet Systems
-----Original Message-----
From: alex handle [mailto:alex.handle@gmail.com]
Sent: Thursday, February 15, 2007 3:52 PM
To: php-general@lists.php.net
Subject: [PHP] remote fopen not working, despite allow_url_fopen = on
Hi all,
i recently upgraded a server from
freebsd 5.x to 6.2
php 4.4.2 -> php 4.4.4
apache 1.3 -> apache 2.2.4.
It worked all great till i noticed that the remote fopen()/file() did not
work.
allow_url_fopen is set to "On" and the httpd-error.log shows this error
message:
[Thu Feb 15 14:15:42 2007] [error] [client xxx] PHP Warning: file() [<a
href='function.file'>function.file </a>]: php_network_getaddresses:
getaddrinfo failed: hostname nor servname provided, or not known in
/home/domains/x/xxx/tmp/remote.php on line 2
[Thu Feb 15 14:15:42 2007] [error] [client xxx] PHP Warning: file(
http://google.com/) [<a
href='function.file'>function.file</a>]: failed to
open stream: Invalid argument in /home/domains/x/xxx/tmp/remote.php on line
2
A lynx from the server to google.com works.
Then i put google.com in the /etc/hosts file and i got this message:
[Thu Feb 15 14:19:47 2007] [error] [client xxx] PHP Warning: file(
http://google.com/) [<a
href='function.file'>function.file</a>]: failed to
open stream: HTTP request failed! in /home/domains/x/xxx/tmp/remote.php on
line 2
With curl i can fetch remote content, but i have to put the domainname in
the hosts file. Verry strange!?
Here my test file:
<?php
var_dump(file('http://google.com/'));
?>
phpinfo and configure.log of the freebsd-ports is attached
Thanks in advance!
Alex