Forums / Installing on a Linux/Unix Server / Undefined global variable $_SESSION and no zc log files

Undefined global variable $_SESSION and no zc log files

Views: 4,006

Results 1 to 3 of 3
20 Feb 2024, 12:43 AM
#1
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

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

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
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

25 Feb 2024, 1:58 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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...

25 Feb 2024, 8:07 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

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

mc12345678:

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).