Configure PHPMYADMIN with NGINX on Ubuntu 18.04

Recently i faced a problem to configure phpmyadmin with nginx on my ubuntu 18.04 machine. After that, i solved the issues and wrote a blog on here. To configure phpmyadmin with nginx first we have to install both phpmyadmin and nginx.

apt get-install nginx
apt get-install phpmyadmin

After install both phpmyadmin and nginx then we have to create a phpmyadmin symbolic to nignx root folder, like below

sudo ln -s /usr/share/phpmyadmin /var/www/html

After that, have to add below lines to nginx config file vim /etc/nginx/sites-available/default

       location /phpmyadmin {
	    root /usr/share/;
	    index index.php index.html index.htm;
	    location ~ ^/phpmyadmin/(.+\.php)$ {
		try_files $uri =404;
		fastcgi_pass   unix:/var/run/php/php7.2-fpm.sock;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

It’s almost done. Now just restart nginx server using this command

service nginx restart

and browse the url