sylius是symfony2旗下很不错的商城,但是在安装过程中出现一些小问题。
在安装sylius时运行命令
1 |
php app/console sylius:install |
出现如下错误
1 2 3 4 5 6 7 8 |
PHP Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Warning: SessionHandler::write(): open(/website/sylius/app/cache/de_/sessions/sess_hb6aigq1o3os7fg5gl98cfkbd0, O_RDWR) failed: No such file or directory (2)' in /website/sylius/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php:77 Stack trace: #0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleError(2, 'SessionHandler:...', '/website...', 77, Array) #1 /website/sylius/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php(77): SessionHandler->write('hb6aigq1o3os7fg...', '') #2 [internal function]: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('hb6aigq1o3os7fg...', '') #3 [internal function]: session_write_close() #4 {main} thrown in /website/sylius/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php on line 77 |
解决办法
在config.yml中添加
1 2 3 4 |
framework: session: handler_id: session.handler.native_file save_path: "%kernel.root_dir%/sessions" |