Install + Running Phpmyadmin on nginx (Ubuntu 16.04)



How to install phpmyadmin on nginx, web server .. in Ubuntu 16.04.

Step :
1) sudo apt-get instal phpmyadmin
2) have two choice, apache / lighthttpd.. select none with click ‘tab’ on your keyboard – then enter.

config : dbconfig-common, select no.

3) sudo gedit /etc/nginx/sites-available/default, copy this script in server{ ..copy here.. }

====
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
==

4) restart nginx, sudo service nginx restart
5) open http://localhost/phpmyadmin

if you getting a error, like this :
502 Bad Gateway.
nginx/1.10.0 (Ubuntu)

you must install php-fpm, with :
sudo apt-get install php5.6-fpm

where 5.6 is your php version.

6) restart again nginx, sudo service nginx restart

7) bingo!

===========
See this video for details.

23 thoughts on “Install + Running Phpmyadmin on nginx (Ubuntu 16.04)

Leave a Reply

Your email address will not be published.