Nginx Configuration for phpMyAdmin

On Debian 9 server with nginx, i installed phpmyadmin with

apt install phpmyadmin

For some reason, ip-address/phpmyadmin did not work. On Ubuntu, it normally ask for for web server you have installed, then configure it during install.

I got this working by adding following code

location /phpmyadmin {
    root /usr/share/;
    location ~ ^/phpmyadmin/(.*\.php)$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
}

Inside default nginx virtual host

/etc/nginx/sites-available/default

Restart nginx with

service nginx restart

Now you will be able to access phpmyadmin with url

http://SERVER-IP-ADDR/phpmyadmin
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *