imqqmi Posted October 19, 2009 Posted October 19, 2009 My hoster just upgraded to php 5.2.11 and mysql 5.0.86 and ever since I can't seem to add products to the shopping cart, it just jumps to an empty shopping cart when I click add product. I've tried cleaning the tmp folder, disable caching and I've tried uploading a last known good backup version of the site. I didn't replace the database yet though. Is there anything known about osC and the newer php and mysql that I should be aware of?
Guest Posted November 4, 2009 Posted November 4, 2009 I'm having the same issue with users having an empty shopping cart no matter how they try to add an item or checkout. I'm using php 5.2.10 and MySQL 5.0.81-community I've trying reinstalling and doing everything I can think of -- playing with the config files thinking it's a cookie problem -- everything. Has anyone found a solution to this????
MrPhil Posted November 4, 2009 Posted November 4, 2009 What PHP and MySQL version were you running on? For PHP, going from v4 to v5 could mean turning off register global variables by default. If your osC is pre-RC1 (MS2 or earlier) that will cause problems. You may also have old mods/contributions that rely on register globals. Some recent PHP 5 versions have started giving out warnings that certain "ereg" functions are deprecated, and won't be supported in PHP 6. You should see such warnings if they're being issued, but it should still work (for now). MySQL v5 is not fully upward compatible with v4. You need to fix some "LEFT JOIN" code. If this is happening, you should be getting some SQL "1054" errors. If you were already successfully running on some level of PHP 5 and MySQL 5, I don't know what would be causing problems. Maybe a mod/contribution that needs updating, or there's something wrong with your host's installation. Have you looked for logged error messages, such as in your site's control panel (e.g., cPanel > Error logs) or in PHP error logs (e.g., osC directories with "error_log" files)? Nothing on-screen?
♥FWR Media Posted November 4, 2009 Posted November 4, 2009 My hoster just upgraded to php 5.2.11 and mysql 5.0.86 and ever since I can't seem to add products to the shopping cart, it just jumps to an empty shopping cart when I click add product. I've tried cleaning the tmp folder, disable caching and I've tried uploading a last known good backup version of the site. I didn't replace the database yet though. Is there anything known about osC and the newer php and mysql that I should be aware of? Try this as a debug Add the following function to includes/functions/general.php You can retain it and use it for debugging later if you wish. // Generic array printout debugger (pa = print array) function pa ( $array, $exit = false, $print = 'print_r' ) { echo '<pre>' . PHP_EOL; $print( $array ); echo '</pre>' . PHP_EOL; if ( false !== $exit ) { exit; } } // End function includes/application_top.php Find .. // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { Add immediately below: - pa( $HTTP_POST_VARS, true ); *** WARNING *** While this code is in application_top.php no one can add to cart so take it straight out after use. Try to add a product to cart then record the output, it will show you what if anything was missing from the _POST. As MrPhil mentioned perhaps some register_globals on reliant code was added to the process somewhere if the _POST key => value(s) needed to add to cart are missing it will give you a starter at least. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
imqqmi Posted November 5, 2009 Author Posted November 5, 2009 Thanks for the help, yesterday it suddenly sprang to live again, I think the hoster wasn't finished with updating or may have changed settings. Weird, but it works so I'm not complaining ;) Good luck xSAKx, I hope it is something similar for you too. @MrPhil I've already ported the code to use 'Register globals: off', no errors on screen, I haven't checked the logs, I know I should have but I wasn't aware that oscommerce wrote some logs in its root. I'm not sure my host allows me to look up logs generated by mysql and php, I'll look into that, as I'm curious how this could have happened and how to avoid it in the future. Thanks a lot guys!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.