View Single Post
  #15  
Old 01-02-2014, 02:45 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)

WARNING!!!

Anyone running older XC versions - you need to either upgrade or do NOT switch to PHP 5.4.x. Talk to your host first and make sure they know about this (Emerson EWD Hosting knows now)

This has been tested (understand - it shutted down a site) on a site running 4.1.8 but it very well may be the case for any XC version below 4.4.x. The site had both 5.3.x and 5.4.x patches applied. All that was accessible on it was home page and direct php scripts.

The reason (from what I found) - XC relies on register_globals to be ON. This php setting has been deprecated in PHP 5.3.x and completely taken out in PHP 5.4.x and up. So this url

www.domain.com/home.php?cat=10

will not pass cat variable to XC scripts in PHP 5.4.x because XC uses it directly as

$cat

instead of

$cat = $_GET['cat'];

type of code, causing $cat in this case to be always 0 which is home page. Same applies to $page, $productid, etc variables passed to the scripts by the urls.

Site in question is now running just fine after host downgraded to PHP 5.3.x, of course this should not have happen and site owner is advised, but....

QT - this post is misleading since the patch provided doesn't fix older XC versions for use with PHP 5.4.x and up. Please fix and provide new 5.4.x patch.

This does not affect newer XC releases like 4.5.x and 4.6.x

P.S. If anyone had tested or running older versions of XC on PHP 5.4.x without any issues please share so we can get to the bottom of this....
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote