debian 8上的Phpmyadmin 500内部服务器错误

问题描述 投票:-1回答:1

我尝试安装和配置我的phpmyadmin,但是当我尝试在website / phpmyadmin上访问时出现此错误

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

这是我在/var/log/apache2/error.log中所拥有的

[Wed Jun 17 06:25:03.213504 2020] [mpm_prefork:notice] [pid 18553] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Wed Jun 17 06:25:03.213527 2020] [core:notice] [pid 18553] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jun 17 17:06:21.488126 2020] [authn_file:error] [pid 22625] (2)No such file or directory: [client 88.125.106.51:64647] AH01620: Could not open password file: /etc/phpmyadmin/.htpasswd

我用此修改了htaccess文件

sudo nano /usr/share/phpmyadmin/.htaccess

并输入此内容

AuthType Basic
Authname "Restricted files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user
mysql .htaccess phpmyadmin vps ovh
1个回答
0
投票

似乎您已经创建了指令来告诉Apache基于/etc/phpmyadmin/.htpasswd文件中定义的用户帐户来限制访问。这就是您添加到.htaccess文件中的四行;您告诉Apache使用HTTP基本身份验证,并要求该文件中包含有效用户。

但是,error.log中的消息指出文件没有退出或无法读取。您应该更改/usr/share/phpmyadmin/.htaccess中的配置(以指向正确的文件),创建文件/etc/phpmyadmin/.htpasswd,或者检查/etc/phpmyadmin/.htpasswd/的权限(如果已存在),以便Apache有权读取该文件。

如果文件确实存在,则Apache无法读取它。检查权限,并确保Apache进程具有读取权限。如果文件不存在,则可以创建它:htpasswd -c /etc/phpmyadmin/.htpasswd any-username。 .htaccess用户独立于操作系统用户运行。

您还将从熟悉Apache文档中受益:https://cwiki.apache.org/confluence/display/HTTPD/PasswordBasicAuth

© www.soinside.com 2019 - 2024. All rights reserved.