I have a droplet serving five websites using Nginx reverse proxy. Everything is working fine, however after installing PhpMyAdmin I’m getting a 404 Not Found error. (http://mysite.com/phpmyadmin)
My nginx error log looks like this:
root@lamp-tor1-01:/usr/share# tail -f /var/log/nginx/error.log
2020/05/09 14:20:33 [error] 32547#32547: *57 directory index of “/var/www/” is forbidden, client: 198.84.238.174, server: 165.227.46.52, request: “GET / HTTP/1.1”, host: “165.227.46.52” 165.227.46.52, request: “GET /phpmyadmin HTTP/1.1”, host: “165.227.46.52” 2020/05/09 14:44:34 [error] 32547#32547: *124 open() “/usr/share/phpMyAdmin” failed (2: No such file or directory), client: 198.84.238.174, server: 165.227.46.52, request: “GET /phpmyadmin HTTP/1.1”, host: “165.227.46.52” 2020/05/09 14:46:37 [error] 32547#32547: *129 open() “/usr/share/phpMyAdmin”
My /etc/nginx/sites-available/default Server Block is as follows:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www;
index index.php index.html index.htm index.nginx-debian.html;
server_name 165.227.46.52;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
My symbolic link looks like this:
lrwxrwxrwx 1 root root 21 May 9 15:01 phpmyadmin -> /usr/share/phpmyadmin
–
All of my sites are working fine with their domains, however if I try and access my ip i get a 403 forbidden error. Maybe this is related, I don’t know.
I know that this is not a new topic, but I have gone through all examples on this message board, and I’m unable to fix it. I have reset my symbolic link, and I have tried a few different configurations of my default server block. I also contacted customer support, but they are responding every 4 days now, and they just give me a link to a tutorial on how to install PhpMyAdmin, which I’ve obviously tried a few times. Any help would be appreciated.
Thanks!
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!
Just to help anyone else stuck on this. I had the wrong version of fastcgi_pass unix:/run/php/php7.0-fpm.sock; because I copied the exact same file from the tutorial. Mine was php7.4 not 7.0, changed in the server block and phpmyadmin loaded no problems
Hi @xar86413,
Looking at the log, it seems like the following path or symlink can’t be found “/usr/share/phpMyAdmin” :
2020/05/09 14:44:34 [error] 32547#32547: *124 open() “/usr/share/phpMyAdmin” failed (2: No such file or directory), client: 198.84.238.174, server: 165.227.46.52, request: “GET /phpmyadmin HTTP/1.1”, host: “165.227.46.52”
This is either a permissions issue or the folder is indeed not there. Please do check it out with the following command
/usr/share/phpmyadmin
If it isn’t, I’ll recommend reinstalling the service following this tutorial step by step exactly how it’s written as it seems something was missed during the configuration:
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.