Magento 1.9 Session Database Error with PHP 7.2 – How to Fix

magento-1.9php-7session

Updated to Magento 1.9.3.10 with PHP 7.2. If I save the sessions in db:

<session_save><![CDATA[db]]></session_save>

I get this error:

Recoverable Error: session_module_name(): Cannot set 'user' save handler by ini_set() or session_module_name() in /var/www/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 83

Best Answer

Unlike stated in the download page at magento.com, Magento > 1.9.3.8 seem still to require the "PHP 7.2 support" patch PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2.

Full output should look like this:

λ patch -p1 < PATCH-1.9.3.1-1.9.3.9_PHP7-2018-09-13-08-01-43.2_v2
patching file app/Mage.php
patching file app/code/core/Mage/Core/Helper/Data.php
patching file app/code/core/Mage/Core/Model/Resource/Session.php
patching file app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
patching file app/code/core/Mage/Core/functions.php
patching file app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php
patching file app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php
patching file app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php
patching file app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php
patching file app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php
patching file app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php
patching file app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php
patching file app/code/core/Mage/Install/etc/install.xml
patching file app/code/core/Mage/Sales/etc/config.xml
patching file app/code/core/Mage/Shipping/Model/Carrier/Abstract.php
patching file app/code/core/Mage/Wishlist/Model/Observer.php
patching file lib/Varien/Autoload.php
patching file lib/Varien/File/Uploader.php
patching file lib/Varien/Io/Sftp.php
patching file lib/mcrypt_compat/mcrypt.php
patching file lib/phpseclib/Crypt/AES.php
patching file lib/phpseclib/Crypt/Base.php
patching file lib/phpseclib/Crypt/Blowfish.php
patching file lib/phpseclib/Crypt/DES.php
patching file lib/phpseclib/Crypt/Hash.php
patching file lib/phpseclib/Crypt/RC2.php
patching file lib/phpseclib/Crypt/RC4.php
patching file lib/phpseclib/Crypt/RSA.php
patching file lib/phpseclib/Crypt/Random.php
patching file lib/phpseclib/Crypt/Rijndael.php
patching file lib/phpseclib/Crypt/TripleDES.php
patching file lib/phpseclib/Crypt/Twofish.php
patching file lib/phpseclib/File/ANSI.php
patching file lib/phpseclib/File/ASN1.php
patching file lib/phpseclib/File/ASN1/Element.php
patching file lib/phpseclib/File/X509.php
patching file lib/phpseclib/Math/BigInteger.php
patching file lib/phpseclib/Net/SCP.php
patching file lib/phpseclib/Net/SFTP.php
patching file lib/phpseclib/Net/SFTP/Stream.php
patching file lib/phpseclib/Net/SSH1.php
patching file lib/phpseclib/Net/SSH2.php
patching file lib/phpseclib/PHP/Compat/Function/array_fill.php
patching file lib/phpseclib/PHP/Compat/Function/bcpowmod.php
patching file lib/phpseclib/PHP/Compat/Function/str_split.php
patching file lib/phpseclib/System/SSH/Agent.php
patching file lib/phpseclib/System/SSH/Agent/Identity.php
patching file lib/phpseclib/bootstrap.php
patching file lib/phpseclib/openssl.cnf
Related Topic