gpt4 book ai didi

Symfony2 : access same route in production as development

转载 作者:行者123 更新时间:2023-12-02 06:43:18 26 4
gpt4 key购买 nike

我正在使用 Symfony2 开发一个小应用程序。我可以在我的开发环境中毫无问题地访问所有路由:

http://symfony/app_dev.php/cp (“symfony”在我的主机文件中解析为本地主机)

但是,当我尝试在生产环境中访问它时,我只是得到一个 404 错误页面:

http://symfony/app.php/cp

Oops! An Error Occurred The server returned a "404 Not Found". Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

在查看生产中的应用程序之前,我需要更改/执行某些操作吗?我没有弄乱任何核心文件(内核/ Bootstrap /应用程序文件等)。我正在使用候选版本 3。

最佳答案

正如 Crozin 在他的评论中提到的那样,您必须重建缓存才能看到您的更改。每次更改配置、路由或模板中的某些内容时,您都需要重建生产缓存。最安全的方法是使用 php app/console cache:clear --env=prod --no-debug (因为 CLI 在开发模式下运行,默认启用调试)。

关于Symfony2 : access same route in production as development,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6631190/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com