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, Aras <manager@xxxxxxxxxx> wrote:

 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@xxxxxxxxxx
Business Excellence Development
Phi.dot Internet Systems


-----Original Message-----
*From:* alex handle [mailto:alex.handle@xxxxxxxxx]
*Sent:* Thursday, February 15, 2007 3:52 PM
*To:* php-general@xxxxxxxxxxxxx
*Subject:*  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/') <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




Hello Aras!

my /etc/resolv.conf is ok - a "host google.com" works and i can reach
google.com with lynx.
There  are  no firewall or dns issues on the server.

[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