php-mysql、php-mbstring 等常用擴展)。yum install epel-release)。sudo yum install phpmyadmin php-mcrypt
sudo yum install phpmyadmin
預設僅允許 127.0.0.1 存取,編輯 /etc/httpd/conf.d/phpMyAdmin.conf:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
<RequireAny>
# Require ip 127.0.0.1
# Require ip ::1
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
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>
<RequireAny>
# Require ip 127.0.0.1
# Require ip ::1
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
<Directory "/usr/share/phpmyadmin">
Order Deny,Allow
# Deny from all
Allow from 0.0.0.0
</Directory>
sudo vi /usr/share/phpmyadmin/config.inc.php
# 設定 32 字元隨機字串
$cfg['blowfish_secret'] = 'kd5G}d33aXDc50!YourRandomStringHere';
# CentOS 7
sudo systemctl restart httpd
# CentOS 6
sudo service httpd restart
瀏覽器訪問 https://<server-ip>/phpmyadmin,出現登入介面即代表部署成功。
