tibberous Posted July 25, 2007 Share Posted July 25, 2007 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. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted July 25, 2007 Share Posted July 25, 2007 Can you post your code, please. Quote Link to comment Share on other sites More sharing options...
tibberous Posted July 25, 2007 Author Share Posted July 25, 2007 <?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' Quote Link to comment Share on other sites More sharing options...
tibberous Posted July 25, 2007 Author Share Posted July 25, 2007 Fixed it. Problem was that ServerName was set wrong in the apache config file. You guys might want to remember the solution to this one, took me a solid hour to fix =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.