RE: remote fopen not working, despite allow_url_fopen = on

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

 



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/'));
  ?>

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

  Thanks in advance!

  Alex




[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