[英]Symfony2 - prod environment doesn't work (page 404)
I have problem with my Symfony2 project. 我的Symfony2项目有问题。 I created new bundle using console, but default controller is avalible only from dev environment level.
我使用控制台创建了新的捆绑软件,但是默认控制器仅在开发环境级别可用。
For 对于
http://localhost/myproject/web/app_dev.php/hello/ZaqU
everything works fine, but for 一切正常,但对于
http://localhost/myproject/web/app.php/hello/ZaqU
i'm redirecting on 我正在重定向
http://localhost/myproject/web/hello/ZaqU
and then i getting only page 404. This is new bundle and i didn't changed default files so I don't understand why it doesn't work. 然后我只得到第404页。这是新的文件包,我没有更改默认文件,所以我不明白为什么它不起作用。 Files:
档案:
/* @FILE: app/AppKernel.php */
$bundles = array(
//...
new ZaqU\TestBundle\ZaqUTestBundle(),
);
. 。
/* @FILE: app/config/routing.yml */
ZaqU_test:
resource: "@ZaqUTestBundle/Resources/config/routing.yml"
prefix: /
Have you tried to clear your prod cache? 您是否尝试过清除产品缓存? Run the following command in the console:
在控制台中运行以下命令:
./app/console cache:clear --env=prod
You might have not enabled the production environment in web/app.php. 您可能尚未在web / app.php中启用生产环境。 Change the false into true.
将false更改为true。
$kernel = new AppKernel('prod', true);
Hope this helps. 希望这可以帮助。
Cheers! 干杯!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.