Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    63,826
    Blog Entries
    5
    Plugin Contributions
    186

    Default PHP 5.3 Support for v1.3.8/a

    ALERT: You REALLY SHOULD BE UPGRADING INSTEAD.

    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.

    Zen Cart v1.3.9 and newer are compatible with PHP 5.3

  2. #2
    Join Date
    Jan 2004
    Posts
    63,826
    Blog Entries
    5
    Plugin Contributions
    186

    Default Re: PHP 5.3 Support

    PHP 5.3 patch for Zen Cart v1.3.8 / v1.3.8a
    ===========================================
    You REALLY SHOULD BE UPGRADING INSTEAD.

    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.x
    (NOTE: if you've applied any other posted bugfixes for v1.3.8a, you'll need to be careful when merging these files along with these patches;
    For that reason, it's not recommended to install this patch unless you *are* actually using PHP 5.3)

    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/classes/phplot.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/classes/installer.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 Attached Files
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    63,826
    Blog Entries
    5
    Plugin Contributions
    186

    Default Re: PHP 5.3 Support

    For v1.3.7 / v1.3.7.1 you may try the following manual edits which cover the basics, but NOT ALL of the possible issues. You really should be upgrading to at least 1.3.9 if you want PHP 5.3 support:



    You REALLY SHOULD BE UPGRADING INSTEAD.

    /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!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v155 PHP 5.4 vs 5.5 support (ZC 1.55 vs 1.54)
    By Woodymon in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 25 Apr 2016, 02:27 AM
  2. PHP 5.3 Support on 1.3.7
    By DogTags in forum General Questions
    Replies: 3
    Last Post: 4 Aug 2010, 03:53 PM
  3. question about PHP 5.3 Support for v1.3.8/a
    By tlyczko in forum General Questions
    Replies: 1
    Last Post: 20 Mar 2010, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR