【发布时间】:2019-02-06 23:49:11
【问题描述】:
我已经解决这个错误超过 4 小时了,“site:stackoverflow.com”上的每个结果在我的谷歌上都是紫色的,我已经尝试了所有建议,但它不起作用。最后,我重新安装了所有 LAMP 堆栈服务,但仍然无法正常工作。如果有人愿意为我解决此问题,我将不胜感激(我仍然是 Linux 新手)。
vi /etc/httpd/conf/httpd.conf
<Directory "/usr/share/phpmyadmin">
AllowOverride None
Options None
Require all granted
</Directory>
vi /etc/httpd/conf.d/phpMyAdmin.conf
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip <workstationip>
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from <workstationip>
Allow from ::1
</IfModule>
</Directory>
我也试过这样做:
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Allow from all
</IfModule>
我还确保了“setenforce 0”,但仍然没有。
我的 httpd 日志显示“服务器配置”阻止了我访问 /usr/share/phpMyAdmin
【问题讨论】:
-
仍未解决。我现在尝试将 'chmod 755' 和 'chmod 777' 和 'chgrp' 和 'chown' 放到 /usr/share/phpMyAdmin 文件夹中,但没有结果
-
确保也设置了
<directory "/usr/share/phpMyAdmin"> Require all granted </directory>,但仍然不起作用。完全重启了,还是不行。
标签: apache phpmyadmin centos