猿问

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

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

我的网站只有4-5静态页面。index.html & index.php两个人都在那里。index.html运行良好。如果我更改为index.php,它将500 Internal Server Error..我不知道我的错误在哪里?

注:如果我用.htaccessphp_flag display_errors 1,

它显示了Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

如果我用.htaccessempty,

它显示了Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

如果我给../contact-us.php它的显示是正确的。

谢谢.。


慕标琳琳
浏览 1691回答 3
3回答

子衿沉夜

如果php代码有致命错误,则显示内部服务器错误,但关闭错误显示。您可以尝试这样做,以查看错误本身,而不是500个错误页:在php文件中:ini_set('display_errors', 1);在.htaccess文件中:php_flag display_errors 1

DIEA

PHP文件的权限必须设置为644。任何包含PHP文件和PHP访问(例如上传文件)的文件夹都必须将权限设置为755。当处理任何权限设置为777的文件或文件夹时,PHP将运行500错误!
随时随地看视频慕课网APP
我要回答