Home > ZenCart > ZenCart 1.3.8 and PHP 5.2.11 Bug: problem login to admin area

ZenCart 1.3.8 and PHP 5.2.11 Bug: problem login to admin area

October 15th, 2009

Yes, I do have some clients that still use ZenCart. In fact, some ZenCart stores are doing very well in terms of SEO and more importantly, sales. This morning, I ran a routine yum update command on one of my clients servers. To my surprise, after rebooting the admin was inaccessible. I’ll share with you the symptoms so you can identify it and the solution that worked for me.

zencart-1.3.8-php-5.2.11-bug

The symptoms:

  1. Not able to login to Admin panel. More importantly, when you try to login it doesn’t show any error message.
  2. No admin is able to login, in other words, the problem is global.
  3. If you look in the php log files, you’ll find a similar line:
    PHP Fatal error:  Class ‘queryFactory’ not found in /var/www/html/includes/functions/sessions.php on line 54, referer: http://www.securepersonalcare.com/admin/login.php

What is happening:

While I am not sure exactly, this post in the ZenCart forums gave up a clue: it was something in PHP 5.2.11. Now, it may be a new bug in this new version or a bug that got resolved and as a result it broke something in the old ZenCart. Note that as of this writing, ZenCart 1.3.8 is about a year and nine months old. In internet time this is a significant amount of time.

The solution that

Once I had an assumption for what the problem is, I worked on reverting the PHP version to an older one. However, when I tried to revert using the Atomic repository – it did not work because while they do make old versions of php available, the php-common is not. I ended up removing the atomic repository and using CentOS repositories which provide PHP ver 5.1.6 something. Reinstalled, restarted apache, and vuala!

Now, only if the ZenCart team will get off their butts (or maybe get on their butts) and finish up what they call the next release of this eCommerce application!! What is the next version 1.4, 1.6, 2.0, 2.5? of ZenCart, well that is another discussion altogether.

ZenCart , ,

  1. | #1

    Yes indeed zen cart is good for seo. Not my words. One of my friend runs a logistics supplies store and he still uses zen cart. Several times we insisted him in using an updated cms for his e-commerce website, but he deliberately sticks on to zen cart. His claims are that its easy to add products and descriptions and moreover he says he is accustomed to using it and it will be difficult for him if he suddenly changes. OK enough of my friend story :D

  2. | #2

    Had this exact same issue on php 5.2.11, and the fix (as silly as it was) was to call the missing classes before the 5.2 bug code.

    in your includes/functions/sessions.php file add this:


    require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.base.php');
    require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'db/' .DB_TYPE . '/query_factory.php');

    where shown below (around line 54):


    function _sess_write($key, $val) {
    global $db;
    if (!is_object($db)) {
    //PHP 5.2.0 bug workaround ...
    require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.base.php');
    require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'db/' .DB_TYPE . '/query_factory.php');
    $db = new queryFactory();
    $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
    }

  3. | #3

    mogmismo, this fix didn’t work for one of our clients. The only thing that worked was rolling back PHP to version 5.2.9. How did you get it to work for you?

Comments are closed.