Home  >  Article  >  Backend Development  >  apache出现500错误的原因是什么

apache出现500错误的原因是什么

PHPz
PHPzOriginal
2016-06-06 20:10:336418browse

apache出现500错误的原因是:1、apache配置文件模块开启问题;2、php.ini文件设置问题;3、权限问题,如果文件没有权限进行读取就会抛出这个错误;4、没有开启rewrite_module。

apache出现500错误的原因是什么

apache出现500错误的原因和解决方法

新手使用apache环境开发时,时不时会遇到"internal server error 500",按照翻译,应该是服务器内部错误,难道apache出错了,Apache破损了,答案显然不是这样的,实际上,就是apache无法正常解析文件,所以就抛出这个错误。

那么,产生这个错误的原因常见是什么呢?

1、apache配置文件模块开启问题

apache中的http.conf文件中关于LoadModule rewrite_module modules/mod_rewrite.so 注释没有打开

2、php.ini文件设置问题:

1)display_errors 改成on

2)error_reporting 改成 E_ALL & ~E_NOTICE

3、权限问题:

文件没有权限进行读取,就会抛出这个错误,这个原因在linux环境对于新手常见。

4、 .htaccess配置错误:

1).htaccess里面的语法错误,

2)没有开启rewrite_module,却进行了rewrite操作,解决见方法1

5、程序出现问题

比如只在访问.php文件的时候报500错误,访问静态文件时候正常。

更多相关知识,请访问 PHP中文网!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn