each() callsPage loads properly
PHP throws an exception in the SessionManager class when ini_set() is called to set the user session save handler.
This seems to be caused by an undocumented breaking change in PHP 7.2, which started in PHP bug 73100 and led to a commit removing the option to set the user session save handler. Instead, users are now required to explicitly call set_save_handler(). This means the ini_set() call changing the save handler no longer works correctly.
Stack Trace
Exception #0 (Exception): Recoverable Error: ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name() in /vendor/magento/framework/Session/SessionManager.php on line 580
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(4096, 'ini_set(): Cann...', '/mage2....', 580, Array)
#1 /vendor/magento/framework/Session/SessionManager.php(580): ini_set('session.save_ha...', 'user')
#2 /vendor/magento/framework/Session/SessionManager.php(184): Magento\Framework\Session\SessionManager->initIniOptions()
#3 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\Session\SessionManager->start()
#4 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Session\Generic\Interceptor->___callParent('start', Array)
#5 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\Session\Generic\Interceptor->Magento\Framework\Interception\{closure}()
#6 /generated/code/Magento/Framework/Session/Generic/Interceptor.php(52): Magento\Framework\Session\Generic\Interceptor->___callPlugins('start', Array, Array)
#7 /vendor/magento/framework/Session/SessionManager.php(130): Magento\Framework\Session\Generic\Interceptor->start()
#8 /generated/code/Magento/Framework/Session/Generic/Interceptor.php(14): Magento\Framework\Session\SessionManager->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
#9 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Session\Generic\Interceptor->__construct(Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Session\SidResolver\Proxy), Object(Magento\Framework\Session\Config), Object(Magento\Framework\Session\SaveHandler), Object(Magento\Framework\Session\Validator), Object(Magento\Framework\Session\Storage), Object(Magento\Framework\Stdlib\Cookie\PhpCookieManager), Object(Magento\Framework\Stdlib\Cookie\CookieMetadataFactory), Object(Magento\Framework\App\State))
#10 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#11 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#12 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#13 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'session', 'Magento\\Store\\A...')
#14 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Store\\A...', Array, Array)
#15 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Store\\A...', Array, Array)
#16 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...')
#17 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...')
#18 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'redirect', 'Magento\\Framewo...')
#19 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Framewo...', Array, Array)
#20 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#21 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#22 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#23 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(230): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'context', 'Magento\\Cms\\Con...')
#24 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Magento\\Cms\\Con...', Array, Array)
#25 /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Cms\\Con...', Array, Array)
#26 /vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Cms\\Con...', Array)
#27 /vendor/magento/framework/App/ActionFactory.php(40): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Cms\\Con...')
#28 /vendor/magento/framework/App/Router/Base.php(297): Magento\Framework\App\ActionFactory->create('Magento\\Cms\\Con...')
#29 /vendor/magento/framework/App/Router/Base.php(158): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)
#30 /vendor/magento/framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))
#31 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#33 /vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#34 /vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#35 /vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#36 /vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#38 /generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#39 /vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#40 /vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#41 /pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#42 {main}
Hi @Alanaktion, where do you see Magento 2.2 is supposed to be PHP 7.2 compatible?
Please check https://github.com/magento/magento2/blob/2.2/composer.json#L11
Hi @Alanaktion
Unfortunately any of the Magento released versions or develop branches do not support and are not compatible with PHP 7.2 at the moment.
We are closing this issue for now as it is going to be addressed when implementing compatibility with 7.2.
Thank you for collaboration.
Is there a public way to track progress on PHP 7.2 support? Simply closing the issue provides no visibility to developers outside of Magento Inc.
@MaxMilton Unfortunately we do not have any publicly available roadmap for PHP 7.2 compatibility. We will post updates via generally available channels when we have any specific information.
Thanks.
Thank you @ishakhsuvarov
I have successfully adapted Magento 2 to PHP 7.2: https://mage2.pro/t/5215
Particularly, the SessionManager fix is here: [PHP 7.2] My fix for 芦Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in lib/internal/Magento/Framework/Session/SessionManager.php on line 129禄.
if (!$this->isSessionExists()) {
ini_set('session.use_only_cookies', '1');
}
and
foreach ($this->sessionConfig->getOptions() as $option => $value) {
if ($option=='session.save_handler') { continue; } else {
$result = ini_set($option, $value); }
works for me!
@Alanaktion if you need any help!
I've got magento 7.1.12 up on php-7.2.0 in production!
Thank you @dmitry-fedyuk, it solved my problem.
@dmitry-fedyuk @southerncomputer @mageho note that it is a really bad idea to use PHP 7.2 on production until https://github.com/magento-engcom/php-7.2-support is finished and merged to mainline.
Most helpful comment
I have successfully adapted Magento 2 to PHP 7.2: https://mage2.pro/t/5215
Particularly, the
SessionManagerfix is here: [PHP 7.2] My fix for 芦Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time inlib/internal/Magento/Framework/Session/SessionManager.phpon line 129禄.