Jump to content

Fopen gives error when reading files from the same domain


tibberous

Recommended Posts

I have a script that is using fopen to see if a file exists or not. It works unless the file it is opening is on the same domain as it, then it gives these errors:

 

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

 

Warning: fopen(http://pubserver.narutofob.com/010.zip) [function.fopen]: failed to open stream: Permission denied in /home/narutof2/public_html/download.php on line 77

 

It looks like maybe fopen doesn't have the permissions to access the file, but I'm not sure what to do about it. Does anyone have any ideas what would cause this?

Link to comment
Share on other sites

Have you tried opening another file, maybe the same directory as the script, and seeing what happens?

Also, what is your code? Are you using the absolute URL for the file (which could be the problem if fopen() isn't enabled to access files externally) or relative?

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.