Ich versuche, Magento 2 auf meinem Centos7 LEMP-Stack zu installieren, aber nach einer erfolgreichen CLI-Installation und dem Einstellen von Magento in den Entwicklermodus wird beim Öffnen der Seite die folgende Meldung angezeigt:
1 exception(s):
Exception #0 (Exception): Warning: SessionHandler::read(): open(/var/lib/php/session/sess_c1qi0gaoj25njvfbt92lee4ao6, O_RDWR) failed: No such file or directory (2) in /var/www/magento2/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
Exception #0 (Exception): Warning: SessionHandler::read(): open(/var/lib/php/session/sess_c1qi0gaoj25njvfbt92lee4ao6, O_RDWR) failed: No such file or directory (2) in /var/www/magento2/vendor/magento/framework/Session/SaveHandler/Native.php on line 22
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'SessionHandler:...', '/var/www/magent...', 22, Array)
#1 /var/www/magento2/vendor/magento/framework/Session/SaveHandler/Native.php(22): SessionHandler->read('c1qi0gaoj25njvf...')
#2 /var/www/magento2/vendor/magento/framework/Session/SaveHandler.php(93): Magento\Framework\Session\SaveHandler\Native->read('c1qi0gaoj25njvf...')
#3 [internal function]: Magento\Framework\Session\SaveHandler->read('c1qi0gaoj25njvf...')
#4 /var/www/magento2/vendor/magento/framework/Session/SessionManager.php(189): session_start()
#5 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\Session\SessionManager->start()
#6 /var/www/magento2/var/generation/Magento/Framework/Session/Generic/Interceptor.php(52): Magento\Framework\Session\Generic\Interceptor->___callPlugins('start', Array, Array)
#7 /var/www/magento2/vendor/magento/framework/Session/SessionManager.php(130): Magento\Framework\Session\Generic\Interceptor->start()
#8 /var/www/magento2/var/generation/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 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): 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 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#11 /var/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#12 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#13 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'session', 'Magento\\Store\\A...')
#14 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Store\\A...', Array, Array)
#15 /var/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Store\\A...')
#16 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Store\\A...')
#17 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'redirect', 'Magento\\Framewo...')
#18 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#19 /var/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#20 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#21 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'context', 'Magento\\Cms\\Con...')
#22 /var/www/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Cms\\Con...', Array, Array)
#23 /var/www/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Cms\\Con...', Array)
#24 /var/www/magento2/vendor/magento/framework/App/ActionFactory.php(40): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Cms\\Con...')
#25 /var/www/magento2/vendor/magento/framework/App/Router/Base.php(300): Magento\Framework\App\ActionFactory->create('Magento\\Cms\\Con...')
#26 /var/www/magento2/vendor/magento/framework/App/Router/Base.php(161): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)
#27 /var/www/magento2/vendor/magento/framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))
#28 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#29 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#30 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'requestPreproce...')
#31 /var/www/magento2/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#32 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#33 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#34 /var/www/magento2/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#35 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#36 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#37 /var/www/magento2/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#38 /var/www/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#39 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#40 /var/www/magento2/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))
#41 /var/www/magento2/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#42 /var/www/magento2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#43 /var/www/magento2/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#44 /var/www/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#45 /var/www/magento2/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#46 {main}
Ich gehe also zu diesen Verzeichnissen und stelle fest, dass der Pfad / var / www / magento2 / var / lib / php / session nicht existiert, aber es gibt einen kürzeren Pfad "var / www / magento2 / var / session" stattdessen und es hat "sess_" -Datei drin.
Soll ich stattdessen eine Konfigurationsdatei ändern, die auf dieses Verzeichnis verweist? Und wenn ja, wo und welche Datei wäre das? Oder ist es etwas ganz anderes?
BEARBEITEN: Mein lokaler Benutzer wurde zur Webserver-Gruppe hinzugefügt und die Berechtigungen werden wie folgt festgelegt:
chown -R myuser:webservergroup /var/www/magento2/
chmod -R 755 /var/www/magento2/
chmod -R 777 /var/www/magento2/var/
chmod -R 777 /var/www/magento2/pub/
Meine PHP.ini ist derzeit wie folgt eingestellt (ursprünglich wurde save_path auskommentiert):
session.save_handler = files
session.save_path = "var/www/magento2/var/session"
PHP.env hatte keine 'save_path'-Direktive, also habe ich sie hinzugefügt:
'session' =>
array (
'save' => 'files',
'save_path' => '/var/session',
),
Aber immer noch das gleiche Problem.
php.ini
. var/session
Dies überschreibt die Standardeinstellung von Magento und kann dieses Problem verursachen. Sehen Sie das .