Symfony 3 Apache 500 Internal Server Error

纵然是瞬间 提交于 2020-01-22 12:59:11

问题


I'm using Symfony 3.2.3 and switched from PHP built-in Web Server to Apache (http://symfony.com/doc/current/setup/web_server_configuration.html, Apache 2.4.18). It works for the root Symfony page (http://example.com/, without Symfony routing), but when I'm creating a controller with a routing (e.g. @Route("/development", name="development")), I got an Apache 500 Internal Server Error. When requesting this side (/development) with PHP built-in Web Server, it works fine. In Apache log I do not get any error message. PHP "display_error" is on, "error_reporting" is "E_ALL" and there is no messsage in php "error_log" file.

Any idea what could be the issue?


回答1:


Look like your problem is your cache hasn't been cleared in production. Run this command:

php bin/console cache:clear --env=prod

Then run:

php bin/console debug:router -e=prod

Which should show all your production routes. By the way running:

php bin/console

shows you all the commands you can run from the command line, if you need to look at anything else.

Hope this helps.



来源:https://stackoverflow.com/questions/42255167/symfony-3-apache-500-internal-server-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!