简体   繁体   English

部署时Symfony2“找不到路由”

[英]Symfony2 “No route found” when deploying

I need to deploy a symfony2 application on shared hosting with cPanel. 我需要在使用cPanel的共享主机上部署symfony2应用程序。 I have managed to upload it, set umask for the app/cache and app/logs directories (by adding the umask(0000) line in the needed files, as per the documentation) but I have a strange problem: 我设法上传了它,为app / cache和app / logs目录设置了umask(根据文档,通过在所需文件中添加umask(0000)行),但是我遇到了一个奇怪的问题:

It appears to stop working randomly whenever I upload new files with ftp. 每当我使用ftp上传新文件时,它似乎都会随机停止工作。 It always spits out "No route found for GET /(whatever-link)" even though the same files work fine on localhost. 即使相同的文件在localhost上运行正常,它始终会显示“找不到GET /(whatever-link)的路由”。 Clearing out the cache folder does nothing. 清除缓存文件夹不会执行任何操作。

Then, here is the strange part - I believe I have noticed after a couple of hours of inactivity it starts working again with no changes to the files. 然后,这是一个奇怪的部分-我相信在几个小时的不活动之后,我注意到它重新开始工作,并且文件没有更改。

This is driving me mad, what am I missing? 这让我发疯,我想念什么?

I have figured out the problem and will provide the solution here, to help some unlucky visitors from the future: 我已经解决了这个问题,并将在此处提供解决方案,以帮助将来一些不幸的访客:

The hosting provider had an older version of eAccelerator enabled - one that strips comments out of php files when caching them. 托管服务提供商启用了较早版本的eAccelerator-在缓存时将注释从php文件中删除。 Needless to say this caused havoc on my entire application. 不用说这对我的整个应用造成了破坏。

I solved it by removing all annotations and instead using yaml for everything, including doctrine mappings. 我通过删除所有注释并改为使用yaml来解决所有问题,包括教义映射。

Read more about the issue here: http://wildlyinaccurate.com/eaccelerator-and-doctrine-2/ 在此处阅读有关此问题的更多信息: http : //wildlyinaccurate.com/eaccelerator-and-doctrine-2/

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

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