Hello Digital Oceans, I’m using ubuntu 16.04 and configured LEMP with this tutorial on it. I tried to add phpMyAdmin with this tutorial , but when I tried to access /phpmyadmin route, I got 404 error. here is my default site-available config file:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name **My_IP_ADDRESS**;
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;
}
}
Am i miss something? Thank you, JavaDroid :)
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!
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.
@javadroid
The symlink created in that guide points to
/usr/share/nginx/www
while yourroot
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:
That won’t delete phpMyAdmin, it’ll just delete the symlink. Now we’ll create a new one using:
Since you’ve set
root
to/var/www/html
, that’s your “home” directory orroot
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:
That should produce something that looks like:
Which means the symlink is valid and should now work when you visit:
Where
IP_ADDR
is your IP address.Hello Digital Oceans, I had nginx, phpmyadmin, mysql, php7.2-fpm on a Ubuntu in browser on 159.89.106.31/phpmyadmin - “couldn’t find this page”
I can not configure phpmyadmin Help me, what am I doing wrong?
My /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html/public; index index.html index.htm index.php; server_name 159.89.106.31; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } }
My /etc/nginx/nginx.conf
user www-data; error_log /var/log/nginx.error_log info; worker_processes auto; pid /run/nginx.pid;
events { worker_connections 768;
}
http { ## # Basic Settings ## disable_symlinks off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable “msie6”; include /etc/nginx/conf.d/.conf; include /etc/nginx/sites-enabled/; }
I add link sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin lrwxrwxrwx 1 root root 22 Mar 13 07:38 phpmyadmin -> /usr/share/ph pmyadmin/
Add /etc/nginx/sites-available/default, copy this script in server{ …copy here… } location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } in browser on 159.89.106.31/phpmyadmin 502 Bad Gateway
I had nginx, phpmyadmin, mariadb, php-fpm on a centos 7. now i just update php5 to php7. and phpmyadmin is not found. so i followed all your steps.even restart nginx, php-fpm. ls -l showing phpmyadmin in my server location directory. but in browser its showing 404. its chown by root:root and chmod 777. phpmyadmin -> /usr/share/phpmyadmin. i know upgrading to php7 uninstall old one, so i download and properly extract phpmyadmin in /usr/share/ directory. no error log found in php/nginx error log files. any idea??