How to install phpMyAdmin on Nginx?

After I install phpmyadmin with “sudo apt-get install phpmyadmin”, how do I set the server block in nginx configuration?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This assumes that you have “/usr/share/nginx/www/” set as the root directory for your Nginx server block. The file “/etc/nginx/sites-enabled/default” should have a section that looks like: <br> <br><pre> <br>server { <br> listen 80; <br> <br> root /usr/share/nginx/www; <br></pre> <br> <br>On newer version of Ubuntu the root might be “/usr/share/nginx/html” In that case you’d need to link phpmyadmin there instead. <br> <br>Could you pastebin your Nginx configuration?

Thanks for the hint, but there is no luck. <br>“ls /usr/share/nginx/www/phpmyadmin” got lots of files listed. <br> <br>When I enter http://my_ip/phpmyadmin <br> <br>The error message shows up as, <br> <br>404 Not Found <br> <br>There must be something wrong. Should I set up something else? <br>