views:

32

answers:

3

Hello,

I have a valid link that goes to a picture located on my web server. It is a simple jpg image, I can copy and paste this link into my web browser and it loads fine. The issue comes in when I try to call a few php functions on the image... such as getimagesize or fopen... they both return 404 errors even though the image is there. Does anyone know that could be causing this?

Thank you for your time.

A: 

Are you using a local path? Or a full URL?

If full, do you have the protocol (e.g. "http") in front of the address? Not having the protocol might make PHP look for the URL in the local scope, which results in the image being not found.

EDIT:

Have you made sure the allow_url_fopen and allow_url_include are enabled on the new server?

Dragory
I have the full url including the http:// On a side note... this only started happening after we moved it to a new server.
Dave C
Have you made sure the allow_url_fopen and allow_url_include are enabled on the new server?
Dragory
Just checked, they are both on.
Dave C
A: 

Is allow_url_fopen enabled? Your installation may not allow opening files by URL.

var_dump( ini_get('allow_url_fopen') );
Adam Backstrom
Oh you ninja'd me, was just adding that to my answer.
Dragory
Yup, all allow_url stuff is enabled.
Dave C
A: 

What happens when you look in your webserver's error log? This will tell you why the URL is returning a 404.

Josh