2013-11-14 79 views
4

當我將應用程序部署到生產服務器時,我得到了生產環境的空白頁面,例如app.phpSymfony2 ContextErrorException:Warning:filemtime():stat failed

不過,我試圖用我的開發環境,以找出問題「* app_dev.php *」,從而註釋的代碼限制了我,然後我得到了以下錯誤:

ContextErrorException:警告: filemtime():stat失敗
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 ContextErrorException:Warning:filemtime():stat失敗C:\ xampp \ htdocs \ deploy \ De mo \ 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

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 

雖然,它工作正常,我的本地機器上。

+0

嘗試清除高速緩存在給定的錯誤Symfony的嘗試,在「C找到模板:\ XAMPP \ htdocs中\。 ..「,這是我認爲你的本地路徑,而不是服務器的路徑 –

+0

是的KyleMit,你是對的,C:\ xampp \ htdocs \ ..是我的本地路徑,但它清除緩存,甚至熱身生產和開發環境,但是我得到了額外的錯誤,我將它附加在問題上,這是因爲對textarea評論的字符數量限制,我感謝你的幫助 – user2992896

+0

看起來像你的代碼庫中的某個地方,你會硬編碼該路徑。你運行搜索項目中的「xampp」字符串?因爲我不明白爲什麼Symfony使用你的本地路徑服務器 –

回答

15

如果有幫助,清除緩存,通過作曲家然後再重新安裝廠商解決我的問題:

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

造成了在我的XDebug配置設置錯誤處理參數同樣的問題。通過註釋掉以下行(註釋字符是分號編輯Xdebug的配置「;」字符

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