phpmyadmin complains about permissions and open_basedir - but they all appear correct

Discussion in 'Server Operation' started by talkingnews, Nov 18, 2014.

  1. talkingnews

    talkingnews New Member

    phpmyadmin has been installed and working fine for months, installed via this repo:

    deb utopic main
    Suddenly, I couldn't login; no in-page errors but the logs showed:

        PHP message: phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php Check group www-data has read access and open_basedir restrictions"
        PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/ Check group www-data has read access and open_basedir restrictions
    So, I checked:

      ll /etc/phpmyadmin
        drwxrwxr-x   3 www-data www-data  4096 Nov 16 20:11 ./
        drwxr-xr-x 132 root     root     12288 Nov 17 15:33 ../
        -rw-r-----   1 www-data www-data   549 Nov 16 20:11 config-db.php

        ll /var/lib/phpmyadmin
        drwxr-xr-x  4 www-data www-data 4096 Oct  8 15:51 ./
        drwxr-xr-x 62 root     root     4096 Nov 12 13:10 ../
        -rw-r-----  1 www-data www-data 4478 Nov 16 19:48
    I followed this SO answer and changed the user and group permissions to match the example (user:root, group:www-data) and changed the directory permissions to match.

    I double, triple checked that no open-basedir restrictions are in effect, and I checked phpinfo(). No open_basedir has ever been in effect or been needed before anyway.
    I tried changing the permissions to be that of the fpm worker pool.
    I rebooted.
    I did a
    sudo apt-get install --reinstall phpmyadm
    The ONLY thing I've done inbetween is to follow this guide to installing freePBX, and 90% of what it wanted was on my machine anyway; only things like sqlite were installed, and I can't even be sure it was that which stopped it working. Long shot, but perhaps worth mentioning.

    Everything else, all other sites etc, are running fine. Before I lose any more hair than I have done in the last 5 hours, I'd really appreciate some ideas. Thanks!
  2. talkingnews

    talkingnews New Member

    The following worked for me, eventually:

        sudo dpkg-reconfigure -plow phpmyadmin
    Choose tcp/ip and NOT socket. Do a full reconfig. Then **reboot the server**.

    For reasons I don't understand, simply restarting the usual services (mysql, nginx, php5-fpm) didn't work.

    I found the suggestion to reboot over at a discussion on DigitalOcean about Ubuntu droplets getting this problem, where a reboot was suggested. However, one answer suggested that this may happen again. For the meantime, it cured my problem.

    Incidentally, it appears that doing a package install on Ubuntu splatters files all over the place, and it goes a little something like this:

    includes the following files in this order, which really won't need touching unless you want to up the login cookie validity.

        /var/lib/phpmyadmin/ // self explanatory
        /var/lib/phpmyadmin/ // LoginCookieValidity etc
        /etc/phpmyadmin/config-db.php // Leave this one alone
        /usr/share/phpmyadmin/ // auth, host, connection etc
    I hope this helps someone else at any rate.

Share This Page