Please take a look at /etc/nginx/site-available/default
where you will need to add location /phpmyadmin
NGINX change phpmyadmin url
-
15-10-2022 - |
Question
I recently changed the url of my site from www.mydomain.com to mydomain.com (no subdomain) running off NGINX on Ubuntu. I had phpmyadmin working at www.mydomain.com/phpmyadmin (using this tutorial: https://www.digitalocean.com/community/articles/how-to-install-phpmyadmin-on-a-lemp-server/), but after changing the url I get a white page after signing in. Is there some phpmyadmin configuration file I need to change to reflect this url change?
Solution 2
OTHER TIPS
this will change your /phpmyadmin to /otherfilename and work for LEMP Server (nginx)
- sudo apt update
- sudo apt install phpmyadmin
- sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
- check your url https://server_domain_or_IP/phpmyadmin
update your vhost with
location /phpmyadmin { root /usr/share/; index index.php; try_files $uri $uri/ =404; location ~ ^/phpmyadmin/(doc|sql|setup)/ { deny all; } location ~ /phpmyadmin/(.+\.php)$ { fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; include snippets/fastcgi-php.conf; } }
sudo service nginx restart
- check again your url to access to phpmyadmin
- cd /var/www/html/
- ls -l
- check phpmyadmin file
create a symbolic file with
sudo mv phpmyadmin otherfilename
ls -l
check your new symbolic file and change your virtual host in 5 point to
location /otherfilename{ root /var/www/html/; index index.php; try_files $uri $uri/ =404; location ~ ^/otherfilename/(doc|sql|setup)/ { deny all; } location ~ /otherfilename/(.+\.php)$ { fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; include snippets/fastcgi-php.conf; } }
sudo service nginx restart
- check your new url https://server_domain_or_IP/otherfilename