user2899965
user2899965

Reputation: 21

Cannot load or save configuration

I get this cannot load phpMyAdmin message. I've tried creating the config folder and the config.inc.php file. When I ĺog on to localhost/phpmyadmin/setup/ it still gives me this message.

Error message: "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 given the www/html folder full rights.

How to I fix this?

thanks in advance!

Upvotes: 2

Views: 1577

Answers (1)

pa4080
pa4080

Reputation: 941

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.

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

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

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.

To allow editing configuration invoke:

/usr/sbin/pma-configure

To block editing configuration invoke:

/usr/sbin/pma-secure

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.

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

Upvotes: 1

Related Questions