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.

Link to comment
Share on other sites

<?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'

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.