对于php文件500内部服务器错误不是HTML [英] 500 Internal Server Error for php file not for html

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

问题描述

有4-5只静态页面我的网站。 的index.html &安培; 的index.php 都在那里。 index.html的工作正常。如果我改变到index.php,它给 500内部服务器错误。我不知道哪里是我的错?

My site having 4-5 static pages only. index.html & index.php both are there. index.html is working fine. If I change to index.php, it's giving 500 Internal Server Error. I don't know where is my mistake?

注:
如果我使用的.htaccess 的php_flag的display_errors 1

它显示此外,遇到了500内部服务器错误错误尝试使用ErrorDocument来处理请求。

如果我使用的.htaccess 文件,

它显示此外,遇到一个404 Not Found错误尝试使用ErrorDocument来处理请求。

如果我给 ../接触us.php ,它显示正常。

And if I give ../contact-us.php, it's showing correctly.

谢谢...

推荐答案

500内部服务器错误显示,如果你的php code的致命错误但不显示被关闭的错误。你可以试试这个,看看错误本身,而不是500错误页面:

500 Internal Server Error is shown if your php code has fatal errors but error displaying is switched off. You may try this to see the error itself instead of 500 error page:

在你的PHP文件:

ini_set('display_errors', 1);

在.htaccess文件:

php_flag display_errors 1

这篇关于对于php文件500内部服务器错误不是HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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