PhpMyadmin-PHP 7

CentOS 7.2, PHP 7, PhpMyadmin 4.6.4

Step 1:

 cd /usr/share

 wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip

 unzip phpMyAdmin-5.0.4-all-languages.zip

 mv phpMyAdmin-5.0.4-all-languages phpmyadmin

 

  #  mv phpMyAdmin-4.7.2-all-languages phpmyadmin

# chown -R apache:apache /usr/share/phpmyadmin

Current version compatible with PHP 5.5 to 7.1 and MySQL 5.5 and newer.

                       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Latest Stable Version

You can also directly download latest version on following URLs:

Step 2:

 

 cd /etc/httpd/conf.d

 touch phpmyadmin.conf

 vi phpmyadmin.conf 

vi /etc/httpd/conf.d/phpmyadmin.conf

 

 ---------put on phpmyadmin.conf following content------------------

 

 Alias /phpMyAdmin /usr/share/phpmyadmin

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin/>

   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>

     # Apache 2.4

     <RequireAny>

      #Require ip 217.x.x.x

      #Require ip ::1

Require all granted  

     </RequireAny>

   </IfModule>

   <IfModule !mod_authz_core.c>

     # Apache 2.2

     Order Deny,Allow

     Deny from All

     Allow from 217.x.x.x

     Allow from ::1

   </IfModule>

</Directory>

<Directory /usr/share/phpmyadmin/setup/>

   <IfModule mod_authz_core.c>

     # Apache 2.4

     <RequireAny>

       Require ip 127.0.0.1

       Require ip ::1

     </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/libraries/>

    Order Deny,Allow

    Deny from All

    Allow from None

</Directory>

<Directory /usr/share/phpmyadmin/setup/lib/>

    Order Deny,Allow

    Deny from All

    Allow from None

</Directory>

<Directory /usr/share/phpmyadmin/setup/frames/>

    Order Deny,Allow

    Deny from All

    Allow from None

</Directory>

--------------------------------------------------------------------------------------

# systemctl restart httpd.service

Create directory for phpMyAdmin temp files.

mkdir -p /var/lib/phpmyadmin/tmp

chown -R apache:apache /var/lib/phpmyadmin

Create directory for phpMyAdmin configuration files such as htpass file.

mkdir /etc/phpmyadmin/

Create phpMyAdmin configuration file.

cp /usr/share/phpmyadmin/config.sample.inc.php  /usr/share/phpmyadmin/config.inc.php

Edit the file

vim /usr/share/phpmyadmin/config.inc.php

Set a secret passphrase – Needs to be 32 chars long

$cfg['blowfish_secret'] = 'H2OxcGXxflSd8JwrwVlh6KW6s2rER63i';

Configure Temp directory ADD this line

$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

$ apachectl configtest

Syntax OK

f you have SELinux in Enforcing mode, you’ll get Permission denied error when you try to access phpMyAdmin page. Allow httpd to serve content in the phpmyadmin directory.

semanage fcontext -a -t httpd_sys_content_t "/usr/share/phpmyadmin(/.*)?"

Apply the policy by running the command.

restorecon -Rv /usr/share/phpmyadmin

Allow http port in the firewall.

firewall-cmd --add-service=http --permanent

Reload firewall reload configuration.

firewall-cmd --reload

http://serverIP/phpmyadmin