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

Subscribe
Share

Which tutorial were you following? Can you also provide some details on what is happening when you try to access phpmyadmin and how you installed it (manually or from the ubuntu package).

Thank you for your comment. I have totally follow this tutorial. Except the restart command.

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server

Last day, i have installed 14.04 and it works. But now, i can’t reach my phpmyadmin. While i access xxx.com/phpmyadmin. My website say that it was 404 page (Wordpress Themes). I have trying to add fast_cgi. But it was Bad Error 502.

Any advice for that?

Thank you, Frans W


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

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.

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.

I have the same problem. To install phpmyadmin, I followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-with-nginx-on-an-ubuntu-14-04-server

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 xxx.com/phpmyadmin, my WP site show a 404 page.

Any idea how can I resolve this issue?