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?

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?

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.