Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    3
    Plugin Contributions
    0

    Default Fatal error: Call to a member function Execute() on a non-object

    I have had this error for a while now, but haven't had the time to attempt to fix it. I decided to go ahead and set up a new ZenCart site, and work on some custom templates. However I can't log into the admin section at all. The admin login screen and the cart front page both display this error.
    Code:
    Fatal error: Call to a member function Execute() on a non-object in /var/www/localhost/htdocs/catalog/includes/functions/sessions.php on line 61
    This is the line in question in the above mentioned file.
    Code:
    line 61 ### $total = $db->Execute($qid);
    I am not sure how to fix this error and have re-installed several times always getting the same error.

    Can this be a problem with php or mysql. I am running php-5.2.2 and mysql-5.0.44. It seems that this problem started with some system updates a little while back.

    TIA................................

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Fatal error: Call to a member function Execute() on a non-object

    It seems you're using an older version of Zen Cart on a newer version of PHP.

    What Zen Cart version did you install?
    .

    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
    May 2006
    Posts
    3
    Plugin Contributions
    0

    Default Re: Fatal error: Call to a member function Execute() on a non-object

    Quote Originally Posted by DrByte View Post
    It seems you're using an older version of Zen Cart on a newer version of PHP.

    What Zen Cart version did you install?
    The Version I have installed is 1.3.7 which appears to be the latest version. I don't remember if I installed the adim patch or not, it's been awhile. I will download a fresh copy of the latest patched version and do a clean install.

  4. #4
    Join Date
    Aug 2006
    Posts
    14
    Plugin Contributions
    0

    Default Re: Fatal error: Call to a member function Execute() on a non-object

    Dr Byte I'm getting the very same error since moving across to a new server.

    Upgrading to the newer version is something I'd like to avoid right at the moment as my 'customisations' weren't written as portably as I would have liked.

    Any advice?

    from the version.php file..

    Major Version 1..

    Minor version.. 3.0.2

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Fatal error: Call to a member function Execute() on a non-object

    Quote Originally Posted by dockarl View Post
    I'm getting the very same error since moving across to a new server.
    Is your new server running a different PHP version ?

    You're probably experiencing the PHP5.2 incompatibility problems others have had when using ZC versions prior to v1.3.6 (where a workaround was added to handle a PHP 5.2 quirk). The fix is documented elsewhere on the forums: http://www.zen-cart.com/forum/showth...534#post287587


    Or there are other thoughts discussed here:
    http://www.zen-cart.com/forum/showthread.php?t=67476
    .

    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.

  6. #6
    Join Date
    Aug 2006
    Posts
    14
    Plugin Contributions
    0

    Default Re: Fatal error: Call to a member function Execute() on a non-object

    Thanks DrByte - that fix worked perfectly.

    For others that have stumbled across this thread via a search as I did, DrBytes Solution is below -

    b. edit /includes/functions/sessions.php and /admin/includes/functions/sessions.php

    Code:
    function _sess_write($key, $val) {
    global $db;
    global $SESS_LIFE;

    change to:

    Code:
    function _sess_write($key, $val) {
    // The following is only to work around a PHP 5.2.0 bug:
    global $db;
    if (!is_object($db)) {
    //PHP 5.2.0 bug workaround ...
    $db = new queryFactory();
    $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
    }

    global $SESS_LIFE;Option (b) may or may not be "complete", and has only had preliminary testing. The best fix will be to have PHP fix their bug, of course.
    ##############################___

 

 

Similar Threads

  1. v1.2.x Fatal error: Call to a member function Execute() on a non-object
    By musikmachine in forum General Questions
    Replies: 1
    Last Post: 15 Feb 2012, 12:21 AM
  2. Fatal error: Call to a member function Execute() on a non-object
    By cyberjyber in forum Upgrading from 1.3.x to 1.3.9
    Replies: 13
    Last Post: 29 Dec 2009, 10:38 PM
  3. Replies: 2
    Last Post: 5 Jul 2008, 04:27 PM
  4. Replies: 6
    Last Post: 4 Jun 2007, 11:42 PM
  5. Replies: 4
    Last Post: 28 Feb 2007, 03:31 PM

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