How To Install PhpMyAdmin On CentOS 8

Step 1: Install phpMyAdmin on CentOS 8

The phpMyAdmin tool is not included in the default CentOS 8 repositories. However, the file can be download manually.

1. In a terminal window, enter the following command to download the phpMyAdmin file:

wget https://files.phpmyadmin.net/phpMyAdmin/4.9.4/phpMyAdmin-4.9.4-all-languages.zip
2. Extract the .zip file archive:

unzip phpMyAdmin-4.9.4-all-languages.zip
3. Move the extracted files to the /usr/share/phpmyadmin directory:

sudo mv phpMyAdmin-4.9.4-all-languages /usr/share/phpmyadmin
4. Change directories:

cd /usr/share/phpmyadmin
5. Rename the sample php configuration file:

sudo mv config.sample.inc.php config.inc.php
6. Open the php configuration file for editing:

sudo vi config.inc.php

7. Find the following line:

$cfg['blowfish_secret'] = '';

8. Edit the line and enter the new php root password between the single-quotes, as follows:

$cfg[‘blowfish_secret’]=’my_password’;

10. Next, create and set permissions on a temporary phpMyAdmin directory:

mkdir /usr/share/phpmyadmin/tmp
chown -R apache:apache /usr/share/phpmyadmin
chmod 777 /usr/share/phpmyadmin/tmp

Step 2: Configure Apache for phpMyAdmin

1. Create an Apache configuration file:

sudo nano /etc/httpd/conf.d/phpmyadmin.conf

2. This creates a new, blank configuration file. Enter the following code:

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4  
     <RequireAny>
      Require all granted
     </RequireAny>
    </IfModule>
    <IfModule !mod_authz_core.c>
      # Apache 2.2
      Order Deny,Allow
      Deny from All
      Allow from 127.0.0.1
      Allow from ::1
    </IfModule>
</Directory>
   
<Directory /usr/share/phpmyadmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

3. Save the file (Ctrl+o) and exit (Ctrl+x).

4. Finally, restart the Apache service to apply the changes made in the configuration file:

systemctl restart httpd

http://207.180.245.226/phpmyadmin/

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat