berrylodge Posted May 28, 2010 Posted May 28, 2010 Hi all, I have been using OSC for a few years now but have no experience of PHP. I have transferred a domain name to my hosting account for a friend who uses OSC for her main business. The site is now hosted on a Windows VPS running PHP 5.2.6 as a FastCGI application with MySQL server version 5.0.45 Whilst the website appears to work OK and the checkout process etc is working I get the following error on all product pages: Warning: imagedestroy(): supplied argument is not a valid Image resource in C:\vhosts\sammaras.co.uk\httpdocs\includes\functions\general.php on line 1345 Can anyone please help? I have tried everything I can think of including re-uploading the entire site and changing permissions where required. The website is www.sammaras.co.uk Many thanks in advance, Bret Never argue with an idiot. They'll drag you down to their level and beat you with experience!
berrylodge Posted June 6, 2010 Author Posted June 6, 2010 Anyone have any ideas? This site is now live and I have still not been able to correct these errors. ANy help is appreciated. Never argue with an idiot. They'll drag you down to their level and beat you with experience!
berrylodge Posted June 13, 2010 Author Posted June 13, 2010 Sorry to be a pain but even a negative response is better than no response at all. Do you have to buy a paid subscription to get help here? Never argue with an idiot. They'll drag you down to their level and beat you with experience!
Jan Zonjee Posted June 13, 2010 Posted June 13, 2010 Sorry to be a pain but even a negative response is better than no response at all. Do you have to buy a paid subscription to get help here? A 10 second search on Google learned me that the function imagedestroy seems to be in the GD library of PHP. Good chance this PHP library is not included in the PHP version your server is using. Check that in the admin (admin/server_info.php) and if so ask your hosting provider about that.
berrylodge Posted June 13, 2010 Author Posted June 13, 2010 Hi Jan, Thanks ever so much for your reply. This is a live site so I was really struggling and couldn't get help anywhere. I agree with what you are saying as I did a Google search myself but having no PHP experience to speak of I was unaware of where to look and how to fix it. I am running a VPS but not sure how I go about adding this library so need to find that out next. Many thanks, Bret Never argue with an idiot. They'll drag you down to their level and beat you with experience!
Jan Zonjee Posted June 13, 2010 Posted June 13, 2010 not sure how I go about adding this library so need to find that out next. Me neither. I'm struggling with this on Mac OSX too :)
MrPhil Posted June 13, 2010 Posted June 13, 2010 The error message is that imagedestroy() (a GD library function) was fed a bad argument. That tells us that the GD library is installed. The problem is somewhere "upstream" of the imagedestroy() call, perhaps due to a defective GD install? Unfortunately, the code in question is part of some add-on (or custom work), not vanilla osC, so I can't tell you where to begin looking. Someone familiar with PHP is going to have to go to the line in question (1345) and examine the argument to the imagedestroy() call (the invalid resource) and trace it upstream, to see where it came from and what might have happened to it. I suspect that the variable is null or 0, rather than a proper "image resource". If you're not familiar with PHP, it would be a waste of time to discuss how to debug this value. What version of osC is this, and what add-ons have been installed? It's possible that the new host uses a newer library that behaves a bit differently -- your code was written for PHP 4 and now you're on PHP 5, which is not perfectly upward compatible. I don't see anything in the PHP manual for differences in this function call between 4 and 5, so undoubtedly it's somewhere upstream. Or, you are running an old osC that still uses register global variables, and values being passed in to a page are now undefined. Or, your new PHP (5) no longer defines "long array name" variables such as $HTTP_POST_VARS (if so, have your programmer change all $HTTP_POST_VARS to $_POST, etc.). Or, there's an error in the PHP installation -- I don't know if there are any tests that your host can run to confirm that GD is properly installed and running OK.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.