X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   News and Announcements (https://forum.x-cart.com/forumdisplay.php?f=28)
-   -   PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12) (https://forum.x-cart.com/showthread.php?t=67915)

aim 11-13-2013 10:22 PM

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

Originally Posted by michaelt13
I used your trick and it solved a few problems, but I still running into these warnings:

Code:

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 240

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 245

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 251

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 254

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 307

Warning: reset() expects parameter 1 to be array, string given in /home/rebeccac/public_html/shop/prepare.php on line 314

Warning: Invalid argument supplied for foreach() in /home/rebeccac/public_html/shop/prepare.php on line 307

Warning: reset() expects parameter 1 to be array, string given in /home/rebe/public_html/shop/prepare.php on line 314

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 307

Warning: reset() expects parameter 1 to be array, string given in /home/rebe/public_html/shop/prepare.php on line 314

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 307

Warning: reset() expects parameter 1 to be array, null given in /home/rebe/public_html/shop/prepare.php on line 314

Warning: Invalid argument supplied for foreach() in /home/rebe/public_html/shop/prepare.php on line 317





http://bt.x-cart.com/file_download.php?file_id=11530&type=bug


http://bt.x-cart.com/view.php?id=43030


IMPORTANT UPDATE based on post #11 of this thread:

Versions 4.1.9 and older require an additional patch (register_long_arrays_for_xc_lt_4.1.10.ver2.diff )

This patch is provided as is, upon request, without testing, as these X-Cart versions are out of guarantee.

spwestwood 12-05-2013 11:50 PM

Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)
 
In case someone who finds this is running X-Cart's Mediatemple's DV server, and they upgrade you from DV 3.5 to DV 4.0 (and thereby to PHP 5.4.13, breaking your xcart and giving you the "Please contact your host administrators and ask them to correct PHP-settings for your site according to the requirements above." error for the register_long_arrays flag):

You can use the scripts on this page to reinstall PHP 5.2.17 on CentOS 6.4 x64, register it with Parallels Plesk, and get X-Cart up and running again:

http://forum.parallels.com/showthread.php?290399-Plesk-11-5-Easy-Install-Script-for-Multiple-PHP-CentOS-6-4-x64

alvaro_nv 12-27-2013 01:59 AM

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

I cant find the php patch, can somebody help with it?

Thank you

Ksenia 12-27-2013 02:10 AM

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

Originally Posted by alvaro_nv
I cant find the php patch, can somebody help with it?

It depends on the version of your store. So please consider submitting a new ticket to the HelpDesk. Specify the URL of the store or its version there, and the specialists will give out the corresponding patch.

cflsystems 01-02-2014 02:45 PM

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....

exsecror 01-03-2014 07:08 AM

Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)
 
We're running 4.2.3 with PHP 5.5.7 and haven't encountered any issues. The only thing we had to do was replace some deprecated eregi methods.

cflsystems 01-03-2014 08:23 AM

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

Originally Posted by exsecror
We're running 4.2.3 with PHP 5.5.7 and haven't encountered any issues. The only thing we had to do was replace some deprecated eregi methods.


That was my understanding as well and yet there is definitely something with XC 4.1.x and PHP 5.4.x.

4.1.8 auth.php

PHP Code:

$cat intval(@$cat);
$page intval(@$page); 


and cart was serving home page only under PHP 5.4.x no matter which category you click on. $cat and $page were always 0. As soon as I changed them to

PHP Code:

$cat intval(@$_GET['cat']);
$page intval(@$_GET['page']); 


they were assigned their proper values and category pages started to show up. Same with $productid in product.php....

So I thought it is the register_globals, reverted everything back and host downgraded to PHP 5.3.x - and no issues.

Although now host is saying register_globals is still OFF yet site works....

So there is definitely something with XC 4.1.x and PHP 5.4.x

The other thing that comes to mind and could be the reason is the "register_long_arrays" - also removed in PHP 5.4.x and required to be ON in older versions of XC

photo 01-03-2014 08:36 AM

Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)
 
I just tested Xcart 4.1.10 on PHP 5.4.22 and the site will not load. I get the following error messages,

1. register_long_arrays = Failed Please check php.ini to correct problem
2. register_globals = Warning Emulation is used

chamberinternet 01-03-2014 08:42 AM

Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)
 
1 Attachment(s)
I get the following running XC 4.1.3 on PHP 5.4.21 (See Attachment)

cflsystems 01-03-2014 08:43 AM

Re: PHP 5.4 compatibility for older versions of X-Cart (4.0.19; 4.1.12)
 
Thanks for confirming. Is this going to be another not tested patch?


All times are GMT -8. The time now is 07:42 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.