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

Advertisement

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
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement