Get the book

Go Back   Zen Cart Support > News and Announcements > Zen Cart Release Announcements

Zen Cart Release Announcements Watch this forum for new releases and other important announcements.
Click here to subscribe to these announcements.

Closed Thread
 
Thread Tools Display Modes
Old 4th November 2009, 04:55 PM   #1
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,609
Default PHP 5.3 Support

PHP 5.3 was released a few months ago, and along with it come many problems due to the PHP authors' decisions to backport many PHP 6 features into 5.3 and deprecate several oft-required functions.

In so doing, they broke many things affecting Zen Cart operation in v1.3.8a and older.

We are preparing a patch which can be used by those whose hosts have upgraded (or have announced imminent plans to upgrade) to PHP 5.3.


We hope to post the patch here very soon. It's in regression testing now.
When the patch is ready it will be announced here in the Announcements area.
DrByte is offline  
Old 9th November 2009, 08:36 PM   #2
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,609
Default Re: PHP 5.3 Support

PHP 5.3 patch for Zen Cart v1.3.8 / v1.3.8a
===========================================

This patch is ONLY needed if you are attempting to run Zen Cart v1.3.8 on a server which is using PHP 5.3
(This patch IS compatible with older versions of PHP, so is safe to install if you're using PHP 4.x or 5.2.x)

THIS PATCH IS **NOT** COMPATIBLE WITH PRIOR VERSIONS OF ZEN CART.
THE ATTACHED ZIP IS ONLY SUITABLE FOR v1.3.8 / v1.3.8a sites.


INSTALLATION INSTRUCTIONS:
==========================
1. Unzip the zc138a-php53patch.zip file, using the option which expands included subdirectories. It's important that you know which subdirectory/folder each file belongs in, as indicated by its location after unzipping.

2. Copy the files to your server. NOTE THE FOLLOWING:

a) If you have NOT customized any of these 11 files on your site already, simply copy the new versions of these files overtop of your existing ones.

b) If you HAVE customized them, either by manual editing or by installing any addons that have altered the files from their original state, you'll need to manually merge the new changes into the files yourself. WinMerge is a handy free tool for doing such merging. http://winmerge.sf.net


11 FILES AFFECTED:
==========================
/admin/includes/application_top.php
/admin/includes/functions/general.php
/admin/includes/functions/html_output.php
/admin/includes/header.php
/admin/includes/modules/orders_download.php
/admin/orders.php
/includes/application_top.php
/includes/functions/functions_general.php
/includes/functions/html_output.php
/includes/modules/payment/paypal/paypal_functions.php
/zc_install/includes/application_top.php

NOTES:
- You will note that there are many similar filenames, such as application_top.php and html_output.php. TAKE CARE THAT YOU USE THE RIGHT VERSION OF THESE FILES! ie: the /admin/includes/application_top.php file IS DIFFERENT FROM the /includes/application_top.php file, which IS ALSO DIFFERENT form the /zc_install/includes/application_top.php file.

- If you are patching a live site, you DO NOT need the zc_install file update on your live server. That file is only needed if you are trying to do a new install on a server running PHP 5.3


And ... for everyone who wonders ...

The "missing" ?> tag at the end of various files is intentional. See this related FAQ: http://tutorials.zen-cart.com/index.php?article=313
Attached Files
File Type: zip zc138a-php53patch.zip (77.7 KB, 222 views)
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!
DrByte is offline  
Old 9th November 2009, 08:38 PM   #3
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,609
Default Re: PHP 5.3 Support

For v1.3.7 / v1.3.7.1 you may try the following manual edits:

/includes/application_top.php
line 51
change:
error_reporting(E_ALL & ~E_NOTICE);
to:
error_reporting(0);


/includes/modules/payment/paypal/paypal_functions.php
line 476
change:
$zc_max_days = date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + (int)DOWNLOAD_MAX_DAYS;
to:
$zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + (int)DOWNLOAD_MAX_DAYS;

/includes/functions/functions_general.php
line 1435
change:
function date_diff($date1, $date2) {
to:
function zen_date_diff($date1, $date2) {


/admin/orders.php
line 53:
change:
$zc_max_days = date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
to:
$zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;


/admin/includes/application_top.php
line 49
change:
error_reporting(E_ALL & ~E_NOTICE);
to:
error_reporting(0);

/admin/includes/functions/general.php
line 2980
change:
function date_diff($date1, $date2) {
to:
function zen_date_diff($date1, $date2) {

The v1.3.8 instructions list additional files which are irrelevant for older versions, which is why some of those filenames are not in this list.

These v1.3.7 instructions may work for older versions. USE AT YOUR OWN RISK. You REALLY SHOULD BE UPGRADING INSTEAD.
__________________
Zen Cart - putting the dream of business ownership within reach of anyone!
DrByte is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need support, now FalseKnight General Questions 0 12th April 2007 11:30 AM


All times are GMT +1. The time now is 11:37 PM.

Learn tips, tricks & secrets for your Zen Cart™
Sign up for our FREE Newsletter

Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content and Graphics Copyright (c) 2006, 2007, 2008, 2009 Zen Ventures, LLC - all rights reserved
Get Zen Cart E-Commerce Shopping Cart at SourceForge.net. Fast, secure and Free Open Source software downloads