1. Install phpMyAdmin.
- apt-get install phpmyadmin
2. Select neither Apache nor Lighttpd for the web server selection as we want to run it inNginx.
3. And say NO for the Configure database for phpmyadmin with dbconfig-common?
4. Append the following settings in /etc/nginx/sites-available/default. Place it inside theserver{}.
/etc/nginx/sites-available/default
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php5-fpm.sock; 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; } |
5. Restart the Nginx/
- /etc/init.d/nginx restart
6. Browse the following URL.
1 | http://<your domain>/phpmyadmin |
Done =)