Symfony 3 Apache 500内部服务器错误 [英] Symfony 3 Apache 500 Internal Server Error

查看:106
本文介绍了Symfony 3 Apache 500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Symfony 3.2.3,并从PHP内置Web服务器切换到Apache( http://example.com/,没有Symfony路由),但是当我在创建带有路由的控制器(例如@Route("/development",name ="development"))时,出现了Apache 500 Internal Server Error.当使用内置的PHP Web Server请求这一面(/开发)时,它可以正常工作.在Apache日志中,我没有收到任何错误消息. PHP"display_error"打开,"error_reporting"打开"E_ALL",php"error_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆