Jump to content

[SOLVED] Problem reading remote file with both fsockopen and fopen


tibberous

Recommended Posts

Whenever I try to read a remote file I get the following two warnings:

 

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/narutof2/public_html/download.php on line 55

 

Warning: fsockopen() [function.fsockopen]: unable to connect to www.example.com:80 in /home/narutof2/public_html/download.php on line 55

 

There the same for both fsockopen and fopen. I tried using real files, same errors occur. I found a post about this online but it doesn't look like they were able to resolve it.

 

Thanks for any help.

 

Btw, this a problem with the server. The code works fine on my local apache server.

<?php

 

if(fopen("http://www.trenttompkins.com/face/project.html", "r"))

  echo "Exists";

else

  echo "Doesn't Exist";

 

?>

 

More info:

 

The server this isn't working on is running Apache 1.3.37 / PHP 4.4.7

 

Configure command is:

 

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr/local' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--with-mhash' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.