This guide will take you through how to install phpMyAdmin with Nginx on Fedora 30. As you already know, phpMyAdmin enables administration of MySQL/MariaDB operations from Web browser.
Install phpMyAdmin with Nginx on Fedora 30
Prerequisites
To install phpMyAdmin with Nginx on Fedora 30, ensure that you have LEMP stack installed. We have covered the installation Nginx, PHP 7.3 and MariaDB 10.3 in our previous guides. See the link below;
Install MariaDB 10.3 on Fedora 30
Install PHP 7.3.4 on Fedora 30
Install Nginx Web Server on Fedora 30
Install phpMyAdmin on Fedora 30
Default Fedora repos provides phpMyAdmin and hence, installation can be done hustle free using the DNF package manager.
dnf install phpmyadmin
Once the installation is done, phpMyAdmin configuration files are installed under /usr/share/phpMyAdmin.
However, the phpMyAdmin Nginx configuration file is installed under the /etc/nginx/default.d/phpMyAdmin.conf. Within this configuration file, phpMyAdmin is set to be accessed from the the Nginx document root folder, /usr/share/nginx/html/phpMyAdmin. An alias of this directory is made to the default phpMyAdmin installation directory stated above.
less /etc/nginx/default.d/phpMyAdmin.conf
# phpMyAdmin
location = /phpMyAdmin {
alias /usr/share/phpMyAdmin/;
}
...
Therefore, for Nginx to server phpMyAdmin content, you need to create a symbolic of phpMyAdmin default install directory to phpMyAdmin Nginx root directory.
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html/
Restart Nginx
Once you are done, restart Nginx.
systemctl restart nginx
Access phpMyAdmin
phpMyAdmin is now ready and can be accessed from the browser using the address, http:/server-IP/phpMyAdmin.
You can login using your database root user credentials.
Well, that is just about it on how to install phpMyAdmin with Nginx. You can now explore phpMyAdmin for your database administration tasks.
See our guide on how to install phpMyAdmin with Apache on Fedora 30 by following link below;
Thanks 😉
Works still in Fedora 40 🙂
With a small addition:
The files in /var/lib/php[MyAdmin] have “apache” user / group membership after the dnf installation (even if the httpd package is not installed).
Nothing what a
find /var/lib/php*/ -user apache -exec chown nginx {} \;
find /var/lib/php*/ -group apache -exec chgrp nginx {} \;
can’t fix…