The Remi repository is used to install the most up-to-date PHP versions and related software on RHEL-based systems such as CentOS and AlmaLinux. Especially when installing web-based database management tools like phpMyAdmin, it is healthier to install from the Remi repository instead of the old versions in the default repositories.
The following steps install PHP 7.4 and phpMyAdmin:
1. Disable other PHP versions
yum-config-manager --disable 'remi-php*'
This command temporarily disables all Remi PHP versions that may be active on the system.
2. Enable the PHP 7.4 repository
yum-config-manager --enable remi-php74
In this step, only the remi-php74
repository is activated. This ensures that tools like phpMyAdmin are installed with versions compatible with PHP 7.4.
3. Install phpMyAdmin
yum --enablerepo=remi install phpMyAdmin -y
The most up-to-date phpMyAdmin package is downloaded from the Remi repository and installed on your system.
4. Create a symbolic link for use with Nginx
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html/phpMyAdmin
This command connects the phpMyAdmin directory to Nginx's default root directory. This allows you to access it through a browser as follows:
http://server-ip/phpMyAdmin
Additional Information:
-
If you are using Apache, you can connect to the Apache root directory such as
/var/www/html/
instead of the Nginx directory. -
After phpMyAdmin is installed, security settings such as access, authentication, and IP restriction should be configured via the
/etc/phpMyAdmin/config.inc.php
file.
Security Recommendations:
-
Change the
phpMyAdmin
directory name to a specific name such asdbpanel
orcontrol
. -
Allow access only to specific IP addresses.
-
Apply additional layers such as HTTP Basic Auth or Fail2Ban.
Thanks to these steps, PHP 7.4 compatible phpMyAdmin installation and access are provided smoothly on a server running with Nginx.