phpMyAdmin“无法加载或保存配置" [英] phpMyAdmin "Cannot load or save configuration"

查看:240
本文介绍了phpMyAdmin“无法加载或保存配置"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在运行优胜美地10.10.2的Macbook Pro上设置phpMyAdmin.我已经在phpmyadmin中创建了一个配置文件夹,并给了它所需的权限:

I have been trying to setup phpMyAdmin on a macbook pro running yosemite 10.10.2. I have created a config folder in phpmyadmin and have given it the permissions required:

chmod o+wr ~/Sites/phpmyadmin/config

但是,当我随后进入"localhost/phpmyadmin/setup"时,出现错误:

However, when I then go onto "localhost/phpmyadmin/setup" I get an error:

Cannot load or save configuration
Please create web server writable folder config in phpMyAdmin top level 
directory as described in documentation. Otherwise you will be only able to 
download or display it.

(我尝试附加图像,但是由于我的声誉而无法)

(I have tried attaching an image, but can't due to my reputation points)

我尝试重置权限,尝试删除并重新创建文件夹.尝试重新下载phpmyadmin zip,但似乎无济于事.

I have tried resetting the permissions, tried deleting and recreating the folder. Tried redownloading the phpmyadmin zip but nothing seems to work.

有人可以建议我做错了什么,以及如何最好地解决这个问题?

Could anyone kindly advise me what I am doing wrong and how I am best placed to solve this issue?

推荐答案

我在Ubuntu 16.04上也遇到了类似的问题.我进行了研究,最后找到了解决该问题的方法.也许我的案件解决方案会对其他人有所帮助.

I have had similar issue on my Ubuntu 16.04. I made a research and in the end I found a resolution of the issue. Maybe my case solution will help somebody else.

背景:出于安全原因,我具有非特权用户和组apache:apache( sudo groupadd apache | useradd -g apache apache ).它们由 /etc/apache2/apache2.conf 中的指令( User apache; Group apache )预置.该用户 apache:apache 拥有Apache2主目录( sudo chown -R apache:apache /etc/apache2 )和其他一些文件,例如: sudo chown -R apache:apache/etc/phpmyadmin/htpasswd.setup

Background: For security reasons I have non privileged user and group apache:apache (sudo groupadd apache | useradd -g apache apache). They are preset by directives (User apache; Group apache) in /etc/apache2/apache2.conf. This user apache:apache owns Apache2 main directory (sudo chown -R apache:apache /etc/apache2) and some other files, for example: sudo chown -R apache:apache/etc/phpmyadmin/htpasswd.setup

在本手册中: http://docs.phpmyadmin.net/en/latest/setup.html -我发现...

In this manual: http://docs.phpmyadmin.net/en/latest/setup.html - I found that...

Debian和Ubuntu已更改了启用和禁用设置的方式, 这样就必须对其中任何一个执行单个命令.

Debian and Ubuntu have changed way how setup is enabled and disabled, in a way that single command has to be executed for either of these.

要允许编辑配置调用:

/usr/sbin/pma-configure

要阻止编辑配置调用:

/usr/sbin/pma-secure

注意!在上面列出的两个文件的内容中,我们谈论的是/var/lib/phpmyadmin/config.inc.php而不是/etc/phpmyadmin/config/config.inc.php. 这是关键.

Note! In the content of the two files listed above we talk about /var/lib/phpmyadmin/config.inc.php instead of /etc/phpmyadmin/config/config.inc.php. It was the key.

就我而言,我修改了这些脚本的内容(请参见下文),现在我可以正确使用localhost/phpmyadmin/setup了.

In my case I was modified the content of these scripts (see below) and now I can use localhost/phpmyadmin/setup properly.

/usr/sbin/pma-configure :

#!/bin/sh
echo "Unsecuring phpMyAdmin installation..."
echo "Setup script can now write to the configuration file."
echo 
echo "Do not forget to run /usr/sbin/pma-secure after configuring,"
echo "otherwise your installation might be at risk of attack."

sudo sudo chown -R apache:apache /var/lib/phpmyadmin/config.inc.php
chmod 0660 /var/lib/phpmyadmin/config.inc.php

/usr/sbin/pma-secure:

#!/bin/sh
echo "Securing phpMyAdmin installation..."
echo "Setup script won't be able to write configuration."

sudo sudo chown -R root:root /var/lib/phpmyadmin/config.inc.php
chmod 0640 /var/lib/phpmyadmin/config.inc.php

这篇关于phpMyAdmin“无法加载或保存配置"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆