Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    Boulder, CO, Dec 2: India
    Posts
    88
    Plugin Contributions
    0

    Default PHP ver. 5.3 -PHP Fatal error: Cannot redeclare date_diff() in

    I'm using v. 1.3.8a with all security patches. I can't afford to upgrade to 1.3.9 right now. I just changed servers, within the same host, so they migrated everything, and all other websites are working. But the PHP version is diff. now, and all pages within the zen cart are giving a blank page, and the error reads:

    PHP Fatal error: Cannot redeclare date_diff() in ...(file path) /store/includes/functions/functions_general.php on line 1476

    In post http://www.zen-cart.com/forum/showthread.php?t=141937 it is recommended to install the patches available from zen cart to take care of this error message. I have replaced the file with the file in the php 5.3 patch. I'm still getting the blank page, and the same error.

    This is the code in the (new) file in question, lines 1472-1479:
    PHP Code:
     $date1_set mktime(0,0,0$m1$d1$y1);
        
    $date2_set mktime(0,0,0$m2$d2$y2);

        return(
    round(($date2_set-$date1_set)/(60*60*24)));
      }

    /** 
    Does anyone see the problem???
    thanks
    JSC

  2. #2
    Join Date
    Feb 2008
    Location
    Boulder, CO, Dec 2: India
    Posts
    88
    Plugin Contributions
    0

    Default PHP Fatal error: Cannot redeclare date_diff() in

    Have had the whole PHP 5.3 answer come as the reason why the zen cart is giving blank pages, had the reply from Dr. Byte to use the patch found here
    http://www.zen-cart.com/forum/showthread.php?t=140960

    -- thank you Dr. Byte.

    I uploaded that patch, in total, double checked all files to be sure they are the right files, and uploaded to the right directories, and the problem still exists. In the original thread I mentioned the file and line # being:
    /includes/functions/functions_general.php on line 1476

    I have since checked on the original file (from a backup 7 days before I replaced the files from the patch recommended by Dr. Byte) - and lines 1465 - 1480 are exactly the same. There is no difference in this file where the error log is locating a fatal error.

    Could it be, there is something more needed here in this file? Or are we absolutely sure that file is fixed? I'm happy if you close this thread also Dr. Byte, but I've been using zen cart since 2006, and despite what is listed under my user name, I'm not a beginner.

    thanks
    JSC

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: PHP Fatal error: Cannot redeclare date_diff() in

    You REALLY need to upgrade to the latest version.
    .

    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.

  4. #4
    Join Date
    Feb 2008
    Location
    Boulder, CO, Dec 2: India
    Posts
    88
    Plugin Contributions
    0

    Default Re: PHP ver. 5.3 -PHP Fatal error: Cannot redeclare date_diff() in

    That's exactly what I'm going to do.

    One of those improvements (php 5.3) which comes with a pretty high price tag.

  5. #5
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: PHP ver. 5.3 -PHP Fatal error: Cannot redeclare date_diff() in

    One of those improvements (php 5.3) which comes with a pretty high price tag.
    Well, look at it this way, 1.3.8a is not secure and 1.3.9h is secure. It just so happens that 1.3.9h works with PHP 5.3.


    As for PHP 5.2, 5.3 and 6, well that's just a mess up by the PHP Project:

    Normally "deprecated" means "you can use it, but it's not recommended and we will remove it in a later version" but with the step-change from 5.2 to 5.3 certain functions are deprecated but means "it's not recommended and so you can't use it".

    They should have upgraded the 5.2 series, with backward compatibility, and left the major changes to the 6 series.

    They certainly weren't thinking of the people who actually use PHP (hosting companies) when they made the changes the way they did. I mean by this that with cPanel it's quite easy to offer customers the choice of two major versions (4 or 5), but there's no mechanism for offering variants of the same version (5.2 and 5.3). So hosting companies have to put in place their own side-by-side solution if they want to offer the choice of 5.2 or 5.3

    Vger

  6. #6
    Join Date
    Feb 2010
    Posts
    11
    Plugin Contributions
    0

    database error Re: PHP ver. 5.3 -PHP Fatal error: Cannot redeclare date_diff() in

    But Now I am having the problem with the PHP 5.3.6, and I have the 1.3.9h version of zencart Installed, Do you have any idea, how to fix it, Does someome knows about a patch? Please reply ASAP, I really need my admin back to work.

 

 

Similar Threads

  1. v139a Compatibility issue: Fatal error: Cannot redeclare date_diff()
    By jgold723 in forum General Questions
    Replies: 7
    Last Post: 9 Feb 2014, 11:12 PM
  2. v150 Fatal error: Cannot redeclare date_diff()
    By gfdesigns in forum Upgrading to 1.5.x
    Replies: 7
    Last Post: 31 Aug 2012, 08:26 PM
  3. Replies: 7
    Last Post: 3 Jun 2012, 04:37 PM
  4. PHP Fatal error: Cannot redeclare class upload
    By cshart in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Dec 2011, 06:33 AM
  5. PHP Fatal error: Cannot redeclare class order
    By sketchhgal in forum General Questions
    Replies: 7
    Last Post: 25 Jun 2010, 09:32 AM

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