开发者

PHP Image Link in Function 404's

开发者 https://www.devze.com 2022-12-27 04:50 出处:网络
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

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 co开发者_开发技巧uld be causing this?

Thank you for your time.


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?


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

var_dump( ini_get('allow_url_fopen') );


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

0

精彩评论

暂无评论...
验证码 换一张
取 消