I fail to understand why PHPmyadmin is forbidden in Nginx

I fail to understand why entrance to PHPmyadmin is forbidden (http://my_ip/phpmyadmin). Here’s what I did to install it:

On a pure Ubuntu 16.04 machine (server, xenial) I’ve installed LEMP this way (MySQL root password setted on install):

apt-get update -y
apt-get upgrade nginx mysql-server php-fpm php-mysql -y

I then installed PMA:

DEBIAN_FRONTEND=noninteractive apt-get upgrade phpmyadmin php-mbstring php-mcrypt php-gettext -y
ln -s /usr/share/phpmyadmin/ /var/www/html/
chown -R www-data:www-data /usr/share/phpmyadmin/ /var/www/html
chmod -R a-x,a=rX,u+w /usr/share/phpmyadmin/ /var/www/html

As said, when navigating to (http://my_ip/phpmyadmin) I get “Forbidden (403)” HTTP status code.

I really fail to understand what’s wrong from the error log:

directory index of “/var/www/html/phpmyadmin/” is forbidden

Hence I ask what might be the problem?

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I struck to such a problem/solution, when PhpMyAdmin wasn’t opening in the browser, giving “403 Forbidden nginx/1.14.0 (Ubuntu)” error.

I had just missed ‘index.php’ in the type of files list in the 443/secure https section block. That’s it. Whole day went to find it. Google too was unable to find me this solution.

Stumbled across this thread while setting up a LEMP 18.04LTS snapshot. It seemsto match my problem. Turned out I didn’t have index.php defined as a supported index in the site config

index index.php index.html index.htm index.nginx-debian.html;

Makes sense as if it can’t find an index it will try to show directory contents, which is forbidden.

Strange, I can suddenly access PMA login screen without WSOD and without any problem, from any browser.

Without any Nginx conf file added…

There might have been a bug fixed in the background after some apt-get update && apt-get upgrade or after some upgrade by unattended-upgrades.