[function.getimagesize]: failed to open stream:

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ravesmith
Forum Newbie
Posts: 2
Joined: Tue Jul 07, 2009 5:32 am

[function.getimagesize]: failed to open stream:

Post by ravesmith »

Hello,
I have taken a web hosting plan from inmotion.com and i have copied all files and folders on inmotion server. I can access my website, but when i access the webpages i get these errors:

Warning: getimagesize(/infob/pics/infob_image_2280_189.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/go2inb5/public_html/infob/readinfo.php on line 1062

Warning: Division by zero in /home/go2inb5/public_html/review/ratereview.php on line 816

pls tell me why its show these errors & provide me the solution for this
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: [function.getimagesize]: failed to open stream:

Post by onion2k »

It's not finding the image "/infob/pics/infob_image_2280_189.jpg". The path is wrong. What the correct setting is depends on the directory structure of the web server.

Total guess: Try changing it to "./infob/pics/infob_image_2280_189.jpg".
ravesmith
Forum Newbie
Posts: 2
Joined: Tue Jul 07, 2009 5:32 am

Re: [function.getimagesize]: failed to open stream:

Post by ravesmith »

it displays the image but it does not resize the image and shows error on top of the page
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: [function.getimagesize]: failed to open stream:

Post by onion2k »

That doesn't change anything. getimagesize() isn't finding the image on the path you've specified. The path is fine for the browser, but it's not fine for PHP. You need to fix it in the script. Ideally, make it relative to the path returned by getcwd().
Post Reply