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

May 31, 2016 1.4k views
Nginx Linux Commands MySQL Linux Basics LEMP Getting Started

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;
return 301 https://$server_name$request_uri;

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

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


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;
# # 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

3 Answers

I have the same problem. To install phpmyadmin, I followed this tutorial:

The install seemed to work.
I restarted PHP as follows: sudo service php7.0-fpm restart
I also restarted nginx as follows: sudo systemctl restart nginx

When I browse to, my WP site show a 404 page.

Any idea how can I resolve this issue?

by Justin Ellingwood
Administering relational databases from the command line can be a daunting proposition for many people. A project called phpMyAdmin aims to alleviate this issue by providing an easy to use web interface for MySQL. In this guide, we'll discuss how to install and secure phpMyAdmin on top of a LEMP (Linux, Nginx, MySQL, and PHP) stack on an Ubuntu 14.04 server.

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.

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

Have another answer? Share your knowledge.