简体   繁体   English

Symfony2 ContextErrorException:警告:filemtime():stat失败

[英]Symfony2 ContextErrorException: Warning: filemtime(): stat failed

When I deploy the application to production server, I got blank page for the production enviroment ie app.php . 当我将应用程序部署到生产服务器时,我得到了生产环境即app.php的空白页面。

However, I tried to figure out the problem by using my development enviroment "*app_dev.php*", thereby commenting the code restricting me, then I got the following errors: 但是,我试图通过使用我的开发环境“* app_dev.php *”找出问题,从而评论限制我的代码,然后我收到以下错误:

ContextErrorException: Warning: filemtime(): stat failed for ContextErrorException:警告:filemtime():stat失败
C:\\xampp\\htdocs\\deploy\\Demo\\src\\SoftMarshal\\Bundle\\MainBundle/Resources/views/Default/index.html.twig C:\\ XAMPP \\ htdocs中\\部署\\演示的\\ src \\ SoftMarshal \\包\\ MainBundle /资源/视图/默认/ index.html.twig
in /var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 165 ContextErrorException: Warning: filemtime(): stat failed for C:\\xampp\\htdocs\\deploy\\Demo\\src\\SoftMarshal\\Bundle\\MainBundle/Resources/views/Default/index.html.twig in /var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 165 在/var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php第165行ContextErrorException:警告:filemtime():对于C:\\ xampp \\ htdocs \\ deploy \\ Demo,stat失败/var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php第165行中的\\ src \\ SoftMarshal \\ Bundle \\ MainBundle / Resources / views / Default / index.html.twig

in /var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 165
at ErrorHandler->handle('2', 'filemtime(): stat failed for C:\xampp\htdocs\deploy\Demo\src\SoftMarshal\Bundle\MainBundle/Resources/views/Default/index.html.twig', '/var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php', '165', array('name' => 'SoftMarshalMainBundle:Default:index.html.twig', 'time' => '1384444091'))
at filemtime('C:\xampp\htdocs\deploy\Demo\src\SoftMarshal\Bundle\MainBundle/Resources/views/Default/index.html.twig') in /var/www/web/bilyonedemo/htdocs/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 165
at Twig_Loader_Filesystem->isFresh('SoftMarshalMainBundle:Default:index.html.twig', '1384444091') in /var/www/web/bilyonedemo/htdocs/app/cache/dev/classes.php line 4582
at Twig_Environment->isTemplateFresh('SoftMarshalMainBundle:Default:index.html.twig', '1384444091') in /var/www/web/bilyonedemo/htdocs/app/cache/dev/classes.php line 4563
at Twig_Environment->loadTemplate('SoftMarshalMainBundle:Default:index.html.twig') in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 131
at TwigEngine->load('SoftMarshalMainBundle:Default:index.html.twig') in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 53
at TwigEngine->render('SoftMarshalMainBundle:Default:index.html.twig', array()) in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 79
at TwigEngine->render('SoftMarshalMainBundle:Default:index.html.twig', array()) in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php line 52
at TimedTwigEngine->render('SoftMarshalMainBundle:Default:index.html.twig', array()) in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 108
at TwigEngine->renderResponse('SoftMarshalMainBundle:Default:index.html.twig', array(), null) in /var/www/web/bilyonedemo/htdocs/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php line 106
at Controller->render('SoftMarshalMainBundle:Default:index.html.twig') in /var/www/web/bilyonedemo/htdocs/src/SoftMarshal/Bundle/MainBundle/Controller/DefaultController.php line 11
at DefaultController->indexAction()
at call_user_func_array(array(object(DefaultController), 'indexAction'), array()) in /var/www/web/bilyonedemo/htdocs/app/bootstrap.php.cache line 2844
at HttpKernel->handleRaw(object(Request), '1') in /var/www/web/bilyonedemo/htdocs/app/bootstrap.php.cache line 2818
at HttpKernel->handle(object(Request), '1', true) in /var/www/web/bilyonedemo/htdocs/app/bootstrap.php.cache line 2947
at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /var/www/web/bilyonedemo/htdocs/app/bootstrap.php.cache line 2249
at Kernel->handle(object(Request)) in /var/www/web/bilyonedemo/htdocs/web/app_dev.php line 29

Although, it works fine on my local machine. 虽然,它在我的本地机器上工作正常。

If it helps, clearing cache, then reinstalling vendors through composer solved my problem: 如果它有帮助,清除缓存,然后通过composer重新安装供应商解决了我的问题:

php app/console cache:clear
php composer.phar install

Had the same problem caused by error handling parameters set in my xdebug config. 有我的xdebug配置中设置的错误处理参数引起的相同问题。 Edited the xdebug config by commenting out the following lines (comment character is the semicolon ";" character. 通过注释掉以下行来编辑xdebug配置(注释字符是分号“;”字符。

; Error Handling
; xdebug.halt_level = E_WARNING
; xdebug.force_display_errors = 1
; xdebug.scream = 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM