Symfony2:使用 /app_dev.php 可以正确显示主页,但使用 /app.php 则不能
Symfony2: home page displayed properly with /app_dev.php but not with /app.php
我有一个位于 /
的主页,在 DefaultController
中定义。它呈现一个 Twig 模板。
当我运行带有http://localhost:8000/app_dev.php/的应用程序时,显示主页。
当我 运行 带有 http://localhost:8000/app.php/ 的应用程序时,我得到典型的:
Welcome to Symfony 2.8.0-DEV
Your application is ready to start working on it at: /
What's next?
Read Symfony documentation to learn
...
留言。如何让app.php
显示主页?
当我浏览 http://localhost:8000/ 时,我得到:
The requested resource / was not found on this server.
您需要清除缓存才能应用更改。
$ php app/console cache:clear --env=prod
来源:http://symfony.com/doc/current/cookbook/console/usage.html
我有一个位于 /
的主页,在 DefaultController
中定义。它呈现一个 Twig 模板。
当我运行带有http://localhost:8000/app_dev.php/的应用程序时,显示主页。
当我 运行 带有 http://localhost:8000/app.php/ 的应用程序时,我得到典型的:
Welcome to Symfony 2.8.0-DEV
Your application is ready to start working on it at: /
What's next?
Read Symfony documentation to learn
...
留言。如何让app.php
显示主页?
当我浏览 http://localhost:8000/ 时,我得到:
The requested resource / was not found on this server.
您需要清除缓存才能应用更改。
$ php app/console cache:clear --env=prod
来源:http://symfony.com/doc/current/cookbook/console/usage.html