简体   繁体   English

Symfony在远程服务器上部署项目ContextErrorException

[英]Symfony Deploying Project on Distant Server ContextErrorException

I am trying to upload my project on the distant server, I simply uploaded the files on the distant server, checked the config.php, which says that all is good. 我试图在遥远的服务器上传我的项目,我只是将文件上传到远程服务器上,检查了config.php,它说一切都很好。 I have removed the if conditions for only local access. 我已经删除了仅用于本地访问的if条件。 But when i try to open the app_dev.php or app.php i keep getting this error 但是当我尝试打开app_dev.php或app.php时,我不断收到此错误

  ContextErrorException: Warning: 
        file_get_contents(C:\wamp2\www\Symfony\src\Les\CouvertsBundle/Resources/views/Couverts/index.html.twig)
        : failed to open stream: No such file or directory 
        in /homepages/26/d367595533/htdocs/Symfony/vendor/twig/twig/lib/Twig/Loader/Filesystem.php line 130

i have not found any answers to this question, maybe not looking for it properly. 我没有找到这个问题的任何答案,也许没有找到正确的答案。 But could anyone explain to me why would this error is occuring? 但有人可以向我解释为什么会出现这个错误? Why is symfony looking for the files with the local address? 为什么symfony要查找具有本地地址的文件?

I followed this tutorial to deploy project in production http://fr.openclassrooms.com/informatique/cours/developpez-votre-site-web-avec-le-framework-symfony2/deployer-son-site-symfony2-en-production . 我按照本教程在生产中部署项目http://fr.openclassrooms.com/informatique/cours/developpez-votre-site-web-avec-le-framework-symfony2/deployer-son-site-symfony2-en-production The steps seem pretty straight forward, but maybe i am missing something. 这些步骤看起来非常简单,但也许我错过了一些东西。

This is really frustrating, because my project is ready but i can't seem to put it online due to this problem. 这真是令人沮丧,因为我的项目已经准备就绪,但由于这个问题,我似乎无法将其置于在线状态。

The problem seemed to be the command php app/console cache:clear and php app/console cache:clear --env=prod didn't completely clear the cache folder. 问题似乎是命令php app/console cache:clearphp app/console cache:clear --env=prod没有完全清除缓存文件夹。

It can happen if the user running the command hasn't the permission to delete files/folder in app/cache/ Manually removing the content of this folder can solve the issue ( rm -rf app/cache/* ). 如果运行该命令的用户没有删除app / cache中文件/文件夹的权限,则可能会发生这种情况。手动删除此文件夹的内容可以解决问题( rm -rf app/cache/* )。

只需在(projectname / app / cache)手动清除缓存,而不是为我工作的命令行(版本2.8)。

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

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