今天在用 Apache+PHP+Mysql 配置网站的时候,最初是很正常的,我学着网上教程不知道修改了哪一个配置文件?然后网站就不能访问了。当我查看了 error.log 日志后,发现日志有如下错误:
[Sat Aug 03 22:37:09 2019] [crit] [client 127.0.0.1] configuration error: couldn't perform authentication. AuthType not set!: /
[Sat Aug 03 22:37:20 2019] [crit] [client 127.0.0.1] configuration error: couldn't perform authentication. AuthType not set!: /index.html
中文翻译
配置错误:无法执行身份验证。 AuthType未设置!:/
配置错误:无法执行身份验证。 AuthType未设置!:/index.html
解决方法
解决方法其实也非常的简单,将“Require all granted”删除或屏蔽。因为这个只有在 Apache2.4或以上高版本才能使用。
以Apache2.2为例子,正确配置如下:
DocumentRoot "F:\phpStudy\WWW"
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
# Require all granted
</Directory>