对于php文件500内部服务器错误不是HTML [英] 500 Internal Server Error for php file not for 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屋!