Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

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

 
Reply
   X-Cart forums > News and Announcements
 
Thread Tools
  #31  
Old 07-22-2014, 12:19 PM
  cliffo4's Avatar 
cliffo4 cliffo4 is offline
 

Member
  
Join Date: Jul 2005
Location: Leicester, UK
Posts: 19
 

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

Have have recently revised our code in 4.0.19 to take on all the security fixes and these updates to fix PHP 5.4. On the surface all looks OK, but in the x-errors_php.txt error log we are now seeing various issues, these first 2 were fine under PHP 5.3, the last seems to be worst or more obvious since we have started to look at the logs more:

Issue1: Alot of these (1 every 20-40 seconds
Code:
[22-Jul-2014 20:49:11 Europe/London] PHP Strict Standards: Only variables should be passed by reference in /home/user/public_html/Smarty-2.6.9/Smarty_Compiler.class.php on line 804
I have no idea where this could be and as its very vague. Any suggestions on how to start to find out what / where it is caused?


Issue 2: Seems MKTime() is depreciated:
Quote:
Note:
As of PHP 5.1.0, this parameter became deprecated. As a result, the new timezone handling features should be used instead.
This is generating the following in the log:
Code:
[21-Jul-2014 18:27:41 UTC] PHP Strict Standards: mktime(): You should be using the time() function instead in /home/user/public_html/admin/statistics.php on line 98
Seems to be 5 or so uses of MKTime() in statistics.php
I have looked at mktime() - I understand what is happening there, but a bit lost for a viable solution to replace it.


Issue 3: Now these been around since our logs go back - is this a Hack attempt? Should we be worried?
Code:
[19-Jul-2014 21:13:00 Europe/London] PHP Warning: include(/home/user/public_html/templates_c/%%3D^3DF^3DF7CB4F%%checkout.tpl.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/user/public_html/Smarty-2.6.9/Smarty.class.php on line 1861 [20-Jul-2014 09:30:59 Europe/London] PHP Warning: readfile(/home/user/public_html/image_path) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: No such file or directory in /home/user/public_html/include/func.php on line 5124 [20-Jul-2014 14:11:48 Europe/London] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '/home/user/public_html/templates_c/%%70^70F^70F20BF0%%product.tpl.php' for inclusion (include_path='/home/user/public_html/include/templater:/home/user/public_html/Smarty-2.6.9/:.:/usr/lib/php:/usr/local/lib/php::.:/usr/local/php5.2.17/usr/lib/php') in /home/user/public_html/Smarty-2.6.9/Smarty.class.php on line 1861

I have searched to see if anyone else reported this, but cant find anything. Surely we can not be the only site to see this if it is a hack/exploit attempt?

Thanks
__________________
X-Cart Gold 4.0.19
http://interstellarsounds.com
Reply With Quote
  #32  
Old 07-22-2014, 06:50 PM
 
Thomasb134 Thomasb134 is offline
 

X-Adept
  
Join Date: Apr 2007
Location: USA
Posts: 789
 

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

1. Can't help on this one.

2. The php manual states that mktime()'s $is_dst param is depreciated, not the entire function. So look for mktime() useage that has 7 parameters (ignore those with 6 or less). The 7th param (when used) is the depreciated $is_dst. As a cheap workaround perhaps you could try removing the offending extra param and see what happens.

3. The weird names in the templatesC directory are the compiled templates. Have you tried admin->Maintenance: Clear templates/X-Cart cache?

Or maybe temporarily disable Settings->General Settings: Do not check if templates are changed (Smarty compile_check), and see if any of the related warnings are suppressed. Not sure if you have this feature in your version, so don't panic if it's missing.
__________________
Thomas / USA
XCart V4.4.5 Gold
XCart Mobile V1.4.12
XCart X-PDF
XCart X-HotProducts
AlteredCart Checkout One (One Page Checkout)
BCSE Back In Stock
CFL Holiday Message
CFL System Message
Smack Digital (WebsiteCM) Remember Anon Carts
xcartmods Testimonials
xcartmods reCAPTCHA for X-Cart Classic
Unix, PHP 7.0 (patched 5.4).
MySQL 5.6
Reply With Quote
  #33  
Old 07-23-2014, 02:59 PM
  cliffo4's Avatar 
cliffo4 cliffo4 is offline
 

Member
  
Join Date: Jul 2005
Location: Leicester, UK
Posts: 19
 

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

For Issue 1, I'm taken the folder Smarty-2.6.19 from X-Cart 4.1.12 and testing that - this seems to have stopped the issues there (I thinking that is more PHP 5.4 happy). This means editing prepare.php and smarty.php to point to the new folder.

For Issue 2, from what I can see in the logs it appears when just mktime() is used, so I have replaced that with time() and that seems to have cureced that. A quick seach through the code base shows that users.php also has an ocurrance, so I have amended that also.

Quote:
Originally Posted by Thomasb134
3. The weird names in the templatesC directory are the compiled templates. Have you tried admin->Maintenance: Clear templates/X-Cart cache?

Or maybe temporarily disable Settings->General Settings: Do not check if templates are changed (Smarty compile_check), and see if any of the related warnings are suppressed. Not sure if you have this feature in your version, so don't panic if it's missing.
The cache has been cleared, and certainly over the time of these errors - like I said, they have been there for a while, only now we trying to action them. The option to Not Check, as you said, is not there.
I am leaning toward my paranoia of hacks and malware, but when its on the live system I will see if the copy of Smarty in Issue 1 may clear this too.
__________________
X-Cart Gold 4.0.19
http://interstellarsounds.com
Reply With Quote
  #34  
Old 11-14-2014, 07:38 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

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

Quote:
Originally Posted by Ksenia
Hi folks.

More and more hosting providers tend to upgrade PHP to v 5.4. At the same time, there are some stores powered by X-Cart v.4.0.x; 4.1.x, which are not compatible with it out of the box. The maintenance team has developed the PHP 5.4 compatibility patch for them.


WHAT ABOUT OTHER VERSIONS:
4.2.0 - 4.2.2 do NOT require this patch if older '4.5.3-compatibility patch' is installed ( it makes your store PHP 5.4 compatible too).
4.2.3 or higher is PHP 5.4 compatible out of the box.

APPLY THESE FIRST:
Before you apply this patch, you should make sure that the corresponding '4.5.3-compatibility patch' is already installed:
for 4.0.19: php5.3.x-patch-2010-06-15_4.0.19.tgz
for 4.1.12: php5.3.x-patch-2010-04-12_4.1.12.tgz

AFTER THE PATCH IS APPLIED:
Make sure $debug_mode is NOT set to 3 in config.php

WHERE TO FIND THE PATCHES
Download the patch (the 'patch-name-{date}_{version}.tgz' archive file) from the 'File area' section of your Qualiteam account.

You can find the patch at
X-Cart -> X-Cart supporting files for prev versions -> {Your X-Cart branch} -> {Your X-Cart version} -> Updates and patches


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.

I am unable to access the php5.3.x-patch-2010-04-12_4.1.12.tgz

Please advise
Thank You
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
Reply With Quote
  #35  
Old 11-14-2014, 10:01 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

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

I was provided the patch by the great folks at Qualiteam, thanks!
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
Reply With Quote
  #36  
Old 04-13-2015, 05:42 AM
 
zefon zefon is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 86
 

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

I did the patches explained here to update a 4.1.8 store. I am having an issue where now the order id numbers are not incrementing. Each order coming in is using the previous order number and overwriting the previous order. Does anyone have any suggestions?
__________________
X-Cart Gold 4.1.8
Reply With Quote
  #37  
Old 04-13-2015, 05:46 AM
  cliffo4's Avatar 
cliffo4 cliffo4 is offline
 

Member
  
Join Date: Jul 2005
Location: Leicester, UK
Posts: 19
 

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

Have you checked the MySQL tables for orders make sure integraty check is all OK?

My understanding is the number is auto generated there that XCart then reads back and uses. Might be worth just running a check / repair
__________________
X-Cart Gold 4.0.19
http://interstellarsounds.com
Reply With Quote
  #38  
Old 04-13-2015, 06:28 AM
 
zefon zefon is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 86
 

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

ok so as an update it appears the problem is related to only orders processed through our credit card processor and not other payment methods. I will contact the developer of the mod we are using.
__________________
X-Cart Gold 4.1.8
Reply With Quote
  #39  
Old 02-19-2017, 12:49 PM
  neonrider's Avatar 
neonrider neonrider is online now
 

X-Adept
  
Join Date: Oct 2005
Posts: 747
 

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

Quote:
Originally Posted by smokinghunks
i was able to fix my XCART Version 4.1.10 to perfect work under PHP 5.4 just by going to the check_requirements.php and editing line 162 from 1 to 0 for the option :

if (phpversion() >= "5.0.0") {
$CHECK_REQUIREMENTS["req_vars"][] = array (
"option" =>"register_long_arrays",
"req_val" =>1,
"real_val"=>"",
"critical"=>0);
}

i hope this can help anybody else with the same issue

Junior

Could you please advise:

1. How do you count 162 lines? My Notepad has 15 long lines for this file.

2. Did you change it already in this code?

"req_val" =>1,
"real_val"=>"",
"critical"=>0)

In other words, did you have "req_val" =>1
and then change it to "req_val" =>0
?

Or did you have "critical"=>1)
and then changed it to "critical"=>0)
?

Which one?

Thanks!
__________________
X-Cart Gold - 4.7.12
Reply With Quote
  #40  
Old 02-27-2017, 08:07 AM
 
thebluedoorboutique thebluedoorboutique is offline
 

Senior Member
  
Join Date: May 2011
Posts: 168
 

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

Disappointed that T-HUB won't be supporting PHP7, causing such a delay for us to launch PHP7.
__________________
X-Cart Classic 4.4.X
Reply With Quote

The following user thanks thebluedoorboutique for this useful post:
neonrider (04-21-2017)
Reply
   X-Cart forums > News and Announcements


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:14 PM.

   

 
X-Cart forums © 2001-2020