I recently upgraded PHP to 5.4 and after adding some tweaks now the old osCommerce installation of a customer with lots of customisations is running again, but there is still a problem:
if you put an item in your cart the cart stays empty
How can I fix this?
Is there a certain php value I can set in php.ini so the session is working properly?
What I have tweaked so far:
Problem: all prices are 0 and there is no currency
!isset($currency) || in the paragraph `//
(see $currency not set in application_top under PHP 5.4 )
Problem: register_globals is REMOVED as of PHP 5.4.0
Solution: I simulated
register_globals with this: https://serverfault.com/a/547285/128892
and I added this to
// Bugfix PHP 5.4: $HTTP_USER_AGENT=$_SERVER["HTTP_USER_AGENT"]; $HTTP_ACCEPT_LANGUAGE=$_SERVER["HTTP_ACCEPT_LANGUAGE"]; $HTTP_HOST=$_SERVER["HTTP_HOST"]; $SERVER_NAME=$_SERVER["SERVER_NAME"]; $PHP_SELF=$_SERVER['PHP_SELF']; $HTTP_GET_VARS=$_GET; $HTTP_POST_VARS=$_POST; register_globals();
comment out this line:
#ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
also I had to correct some removed functions in
Items filled into the cart don’t get added to the cart. seems like the session isn’t known in the add_cart page.