Re: remote fopen not working, despite allow_url_fopen = on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/15/07, alex handle <alex.handle@xxxxxxxxx> wrote:

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/') <http://google.com/%27%29>);
?>

phpinfo and configure.log of the freebsd-ports is attached

 <http://www.dict.cc/englisch-deutsch/Thanks+in+advance+TIA.html>Thanks in
advance!

Alex



A minute ago i tried to run my test script (remote.php) on the shell and the
remote fopen works!!
The problem must be within the php apache module or apache self.
Is there a way to debug the php apache module?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux