Question

Can't Connect to phpMyadmin On Ubuntu 16.04 / Nginx / HTTPS

Hello Digital Oceans, May i know why i can’t access my phpmyadmin on Nginx and Ubuntu 16.04? I have following all of the tutorial, but the page can’t be reach.

server {
listen 80;
listen [::]:80;
root /var/www/xyz/html;
server_name tenpotech.com www.tenpotech.com;
return 301 https://$server_name$request_uri;
}

# SSL configuration
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/ssl-tenpotech.com.conf;
include snippets/ssl-params.conf;

root /var/www/xyz/html;
index index.php index.html index.htm index.nginx-debian.html;

server_name tenpotech.com www.tenpotech.com;

location ~ /.well-known {
allow all;
}

location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}

location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}

Am i miss something?

Thank you, Frans W

Show comments

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 was able to get it worked by making minor change in symlink part as following:

sudo ln -s /usr/share/phpmyadmin /var/www/html

The symlink created in that guide points to /usr/share/nginx/www while your root directive points to another directory. Unless you specify another location block, NGINX doesn’t technically know that the directory exists, and doesn’t know where to route the incoming request.

First, remove the symlink you just created by running:

rm -rf /usr/share/nginx/www That won’t delete phpMyAdmin, it’ll just delete the symlink. Now we’ll create a new one using:

sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin Since you’ve set root to /var/www/html, that’s your “home” directory or root path that your server block uses. What the above command does is create a symlink from where the phpMyAdmin files are to your root directory.

Once the new symlink is there, you should be able confirm that by running:

ls -al /var/www/html

Whole detail can be found here! https://www.digitalocean.com/community/questions/phpmyadmin-got-404-not-found-error-on-nginx-ubuntu-16-04

I opened up a support ticket for installing phpMyAdmin on my Ubuntu 16.04 LEMP configuration. I got a response and I am trying to make it work now. Once it is fully functional, I will leave a post here on how I got it working.