I just installed LEMP stack but my phpmyadmin is acting weird every time I log in. After login, I always get error 404.
This is the URL after logging in (NOTE the user is now logged in):
and I get error 404.
When I type localhost/phpmyadmin, it now works normally.
31 Answer
This is a : no need to think setup for Ubuntu 16.04 with php7-fpm already installed.
sudo apt-get install phpmyadminThen copy paste just before the last } of the file the following block into /etc/nginx/sites-avaliable/default
location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } }Save and restart nginx with :
sudo service nginx restart 5