Support Forum

Image Can Not Be Found

FI fiddlerman
fiddlerman
Member

I recently moved my site to a new dedicated server and am now receiving this warning when members, including myself upload pictures. We can get the pictures to show up but it still shows as [Image Can Not Be Found].

What kind of housekeeping should I do after moving the site? Any idea as to what causes this?

Here is a link to the last one that I saw:
http://fiddlerman.com/forum/fiddle-violin-repair-making-and-set-up/string-sized-files/#p52913

16 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

The problem comes about because if you are using the auto-pop-up-enlargment feature then SP needs to know the width of the image file. The width should really be an attribute of the image tag but sadly a lot of users do not include it. The way SP tries to find out is to send a request to the server hosting the image using a getimagesize() php function call. But to use this successfully then the setting ‘allow_url_fopen’ in your php ini file has to be turned on. It sounds like yours may not be and I would ask your host if it can be turned on.

We are looking into this to see if there is an alternative method but so far we haven’t found anything as good!

FI fiddlerman
fiddlerman
Member

Thanks YS,

I have a dedicated server, is this not something I can do my self in the cPanel? Or by changing the php file?

Pierre

MP Mr Papa
Mr Papa
Member

yes, its a setting in the php.ini file…  Andy was asking you to check its current setting…  we suspect that it may be causing these issues on a few servers (most dont disable it)…

FI fiddlerman
fiddlerman
Member

root@Fiddlerm [~]# cat /usr/local/lib/php.ini | grep allow_url_fopen
allow_url_fopen = On
root@Fiddlerm [~]#

MP Mr Papa
Mr Papa
Member

then a bit of a puzzle… is the url to the image correct?  you will need to check the database for the post in question… you can use the forum tools for the properties function and get the post id…

the php function getimagesize() is failing to return info on the image…

I think you stated earlier the permissions looked correct… please check the owner (uid, gid) too… and check wp-content, sp-resources and the image uploads directory…   they should all basically match wp-content

FI fiddlerman
fiddlerman
Member

The url is correct.

http://fiddlerman.com/wp-content/forum-image-uploads/raywells/2014/01/string-sized-files.jpg

I just tried to upload a picture as well. It no longer shows after uploading it. The HTML editor shows this:

<p><img title=”longhairbandana.JPG” alt=”longhairbandana.JPG” src=”http://fiddlerman.com/wp-content/forum-image-uploads/admin/2014/01/longhairbandana.JPG” width=”0″ height=”0″ /></p>

http://fiddlerman.com/forum/fiddle-violin-repair-making-and-set-up/string-sized-files/#p52995

Obviously I can edit the code on each post to get it to work but it’s not working correctly automatically.

MP Mr Papa
Mr Papa
Member

so yeah still confused as to why getimagesize() is unable to reach the file… its seems web accessible…

can you paste the contents of a phpinfo() run here?

ME Meztli
Meztli
Member

Yellow Swordfish said
We are looking into this to see if there is an alternative method but so far we haven’t found anything as good!

That’s a pity.

I would not recommend enabling the allow_url_fopen directive. PHP scripts that can access remote files are potentially vulnerable to arbitrary code injection.

I am still hoping for an alternative method. :)

Cheers

P.S.

By the way, Happy New Year!

FI fiddlerman
fiddlerman
Member

Mr Papa said
so yeah still confused as to why getimagesize() is unable to reach the file… its seems web accessible…

can you paste the contents of a phpinfo() run here?

Pardon my ignorance, but where will I find the phpinfo?

Thanks

 

MP Mr Papa
Mr Papa
Member

ah sorry, its a temp php file you add to your server and run…

see:  https://kb.mediatemple.net/questions/764/How+can+I+create+a+phpinfo.php+page%3F#gs

FI fiddlerman
fiddlerman
Member

Weird, ignore this post. My Browser never refreshed and I kept trying to get it to post. Confusing. LOL

FI fiddlerman
fiddlerman
Member

Great, I made the phpinfo file but where exactly should I upload it? Which folder? How do I get the information aftwards? What kind of test do I do while the file is getting it’s information, should I upload a picture again with the file in place?

Thanks

MP Mr Papa
Mr Papa
Member

upload it anywhere to your server… then load it in our your browser…  so if you call it phpinfo.php and put in your server root, load up http://myserver.com/phpinfo.php