为了账号安全,请及时绑定邮箱和手机立即绑定

500 php文件内部服务器错误,而不是html

500 php文件内部服务器错误,而不是html

慕标琳琳 2019-07-03 17:16:19
500 php文件内部服务器错误,而不是html我的网站只有4-5静态页面。index.html & index.php两个人都在那里。index.html运行良好。如果我更改为index.php,它将500 Internal Server Error..我不知道我的错误在哪里?注:如果我用.htaccess与php_flag display_errors 1,它显示了Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.如果我用.htaccess与empty,它显示了Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.如果我给../contact-us.php它的显示是正确的。谢谢.。
查看完整描述

3 回答

?
子衿沉夜

TA贡献1828条经验 获得超3个赞

如果php代码有致命错误,则显示内部服务器错误,但关闭错误显示。您可以尝试这样做,以查看错误本身,而不是500个错误页:

在php文件中:

ini_set('display_errors', 1);

在.htaccess文件中:

php_flag display_errors 1


查看完整回答
反对 回复 2019-07-03
?
DIEA

TA贡献1820条经验 获得超2个赞

PHP文件的权限必须设置为644。任何包含PHP文件和PHP访问(例如上传文件)的文件夹都必须将权限设置为755。当处理任何权限设置为777的文件或文件夹时,PHP将运行500错误!


查看完整回答
反对 回复 2019-07-03
  • 3 回答
  • 0 关注
  • 1690 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信