It appears as though PHP has assigned the bug to someone for fixing.
However, in the meantime, you have two options:
a. use file-based caching instead of database-based (not really a good solution, but works around the problem, but is less secure and much less flexible for most hosting environments. 'db' is really the better choice except in the case of this PHP bug):
configure.php file:
define('STORE_SESSIONS', '');
OR:
A Suggested Bandage:
b. edit /includes/functions/sessions.php
and /admin/includes/functions/sessions.php, if it exists on your site:
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.
NOTE: If this fix "works" for you, then you need to upgrade your version of Zen Cart ... sooner than later. The latest version of Zen Cart contains a number of fixes related to PHP5 and MySQL5. You should plan your upgrade ... soon.
Addendum: There are some other technical approaches which could be used to address the session_write_close() and register_shutdown_function() changes introduced in this new PHP version. These may be explored in the future. For now, the above approaches are the simplest to implement for those needing to make a quick-fix to their code.
Bookmarks