Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    257
    Plugin Contributions
    6

    Default Undefined global variable $_SESSION and no zc log files

    zc158a; PHP 8.2.15; PHP Memory Limit: 128M; DB MySQL 10.6.16-MariaDB-0ubuntu0.22.04.1

    Note: This is no longer a problem on my site and the information is posted here for the search engines to find for future reference.

    I could not edit one database record, found by chance, when checking on stock returned. The order details screen showed the order number and the remainder of the page was blank. No Zen Cart error logs were displayed.

    I was getting the following error in my Apache logs
    Code:
    PHP Warning:  Undefined global variable $_SESSION in .../includes/extra_configures/enable_error_logging.php on line 84
    with no zen cart error logs generated.

    The problem was inadequate permissions on the logs folder. This was resolved when the folder permission was set to 774.
    When the log files could be generated I had Zen Cart error logs complaining about duplicate defined names. These were due a legacy language file existing beside a 158 format lang file.

    The duplicate defines errors does not occur on my Windows development machine or on my linux test machine.

    When these redundant files were removed and no further zc log files were generated. The database record displayed correctly.
    OldNGrey
    ZC158a PHP 8.2.15
    MySQL 10.6.16-MariaDB

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Undefined global variable $_SESSION and no zc log files

    I'm possibly wrong, but the duplicate definition logging issue could be or could have been averted through the logging configuration settings.

    The missing session issue likely occurred because the problem occurred before either the session code was loaded or the language code but after the error logging was initiated. This was resolved through one of 250+ PRs on the v158 branch after version 1.5.8a was released. Specifically: Allow intended error logging before `$_SESSION` set by mc12345678 · Pull Request #5868 · zencart/zencart (github.com)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,498
    Plugin Contributions
    88

    Default Re: Undefined global variable $_SESSION and no zc log files

    Quote Originally Posted by mc12345678 View Post
    I'm possibly wrong, but the duplicate definition logging issue could be or could have been averted through the logging configuration settings.

    The missing session issue likely occurred because the problem occurred before either the session code was loaded or the language code but after the error logging was initiated. This was resolved through one of 250+ PRs on the v158 branch after version 1.5.8a was released. Specifically: Allow intended error logging before `$_SESSION` set by mc12345678 · Pull Request #5868 · zencart/zencart (github.com)
    Since the issue was thrown by a file in the extra_configures sub-directory, the logging configuration has no play in the issue since files in that sub-directory are loaded prior to initiating database access (i.e. where those configuration settings are stored).

 

 

Similar Threads

  1. Undefined global var $_SESSION
    By liderbug in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 26 Nov 2023, 06:31 PM
  2. v157 Undefined index and undefined variable errors in paypalwpp
    By Dave224 in forum PayPal Express Checkout support
    Replies: 9
    Last Post: 7 Jan 2022, 05:11 PM
  3. Replies: 9
    Last Post: 9 Aug 2021, 06:00 AM
  4. v154 Naming a global variable the same as a SESSION, GET or POST variable
    By torvista in forum General Questions
    Replies: 5
    Last Post: 6 Dec 2015, 11:11 AM
  5. Need help adding $_SESSION variable
    By chadderuski in forum General Questions
    Replies: 4
    Last Post: 14 Jun 2010, 04:30 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