Symfony 2.8-Session和Twig的问题



我在没有ssh的主机上部署了symfony 2.8中的小型应用程序。复制了所有没有缓存和日志的文件,克隆了数据库。当我转到地址:address.com/web/app.php时,应用程序显示错误:

Warning: SessionHandler::read(): open(/web/clients/www/3/a/8/8/address.com/tmp/sess_9ff0c94b9bd261554814764d051524e0, O_RDWR) failed: No such file or directory (2) in /app/cache/prod/classes.php on line 431
Warning: include(/web/clients/www/3/a/8/8/address.com/vendor/composer/../twig/twig/lib/Twig/Cache/Filesystem.php): failed to open stream: No such file or directory in /vendor/composer/ClassLoader.php on line 444
Warning: include(): Failed opening '/web/clients/www/3/a/8/8/address.com/vendor/composer/../twig/twig/lib/Twig/Cache/Filesystem.php' for inclusion (include_path='.:/opt/httpd-clients/php-7.2.10/lib/php') in /vendor/composer/ClassLoader.php on line 444
Warning: include(/web/clients/www/3/a/8/8/address.com/vendor/composer/../twig/twig/lib/Twig/Cache/Filesystem.php): failed to open stream: No such file or directory in /vendor/composer/ClassLoader.php on line 444
Warning: include(): Failed opening '/web/clients/www/3/a/8/8/address.com/vendor/composer/../twig/twig/lib/Twig/Cache/Filesystem.php' for inclusion (include_path='.:/opt/httpd-clients/php-7.2.10/lib/php') in /vendor/composer/ClassLoader.php on line 444
Fatal error: Uncaught SymfonyComponentDebugExceptionClassNotFoundException: Attempted to load class "Twig_Cache_Filesystem" from the global namespace. Did you forget a "use" statement? in /web/clients/www/3/a/8/8/address.com/app/cache/prod/classes.php:3212 
Stack trace: #0 /web/clients/www/3/a/8/8/address.com/app/cache/prod/classes.php(3149): Twig_Environment->setCache('/web/clients/ww...') 
#1 /web/clients/www/3/a/8/8/address.com/app/cache/prod/appProdProjectContainer.php(2476): Twig_Environment->__construct(Object(SymfonyBundleTwigBundleLoaderFilesystemLoader), Array) 
#2 /web/clients/www/3/a/8/8/address.com/app/bootstrap.php.cache(2271): appProdProjectContainer->getTwigService() 
#3 /web/clients/www/3/a/8/8/address.com/app/cache/prod/appProdProjectContainer.php(2505): SymfonyComponentDependencyInjectionContainer->get('twig') 
#4 /web/clients/www/3/a/8/8/address.com/app/bootstrap.php.cache(2271): appProdProjectContainer->getTwig_Controller_ExceptionService() 
#5 /web/clients/www/3/a/8/8/address.com/app/cache in /app/cache/prod/classes.php on line 3212
Warning: SessionHandler::write(): open(/web/clients/www/3/a/8/8/address.com/tmp/sess_9ff0c94b9bd261554814764d051524e0, O_RDWR) failed: No such file or directory (2) in /app/cache/prod/classes.php on line 435
Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: /web/clients/www/3/a/8/8/address.com/tmp) in %s%02d on line 0

我将chmod 777添加到缓存和日志目录中。有什么想法吗?

这是一个典型的权限问题。您应该清除缓存,然后递归地添加适当的权限,如下所示:

chmod -R 775 /cache

最新更新