Symfony 3 Apache 500 Internal Server Error

2019-04-02 15:12发布

问题:

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.



回答2:

the same problem i had and i fixed it doing the same that some people say here. give full permiss to the var folder. FINALLY!