Symfony 3 Apache 500 内部服务器错误 [英] Symfony 3 Apache 500 Internal Server Error
问题描述
我正在使用 Symfony 3.2.3 并从 PHP 内置 Web 服务器切换到 Apache (http://symfony.com/doc/current/setup/web_server_configuration.html,Apache 2.4.18).它适用于根 Symfony 页面(http://example.com/,没有 Symfony 路由),但是当我我正在创建一个带有路由的控制器(例如 @Route("/development", name="development")),我遇到了 Apache 500 内部服务器错误.当使用 PHP 内置 Web 服务器请求此端 (/development) 时,它工作正常.在 Apache 日志中,我没有收到任何错误消息.PHPdisplay_error"开启,error_reporting"为E_ALL",phperror_log"文件中没有消息.
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?
推荐答案
看起来你的问题是你的缓存在生产中没有被清除.运行这个命令:
Look like your problem is your cache hasn't been cleared in production. Run this command:
php bin/console cache:clear --env=prod
然后运行:
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.
希望这会有所帮助.
这篇关于Symfony 3 Apache 500 内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!