預設安裝完後發現mcrypt與mbstring沒有安裝,於是安裝:
yum install php-mcrypt
yum install php-mbstring
但是還搞不定,Why?新版CentOS的官方源為了安全,不再預設包含mcrypt了,只有自己動手了。
先 php -version ,出來是5.3.3,好吧
wget http://dl.fedoraproject.org/pub/epel/6/i386/php-mcrypt-5.3.3-1.el6.i686.rpm
wget http://dl.fedoraproject.org/pub/epel/6/i386/libmcrypt-2.5.8-9.el6.i686.rpm
rpm -Uvh php-mcrypt-5.3.3-1.el6.i686.rpm libmcrypt-2.5.8-9.el6.i686.rpm
安裝phpmyadmin
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
yum install phpmyadmin
然後 service httpd restart 搞定。。
配置phpmyadmin
修改/usr/share/phpmyadmin/config.inc.php
- #將這裡abcde文字修改為自己的字元,可任意
- $cfg['blowfish_secret'] = 'abcde';
常見問題
1. phpmyadmin提示未開啟php-mcrypt,這是因為沒有安裝php-mrcrpt擴充。在官方源沒有php-mrcrpt擴充,請安裝epel源後再yum install php-mcrypt
2. phpmyadmin無法訪問
phpmyadmin預設只能使用http://localhost/phpmyadmin來訪問,可以修改/etc/httpd/conf.d/phpmyadmin.conf中對應部分為
- <Directory "/usr/share/phpmyadmin">
- Order Deny,Allow
- # Deny from all
- Allow from All
- </Directory>
不過強烈不支援這麼做的,把phpmyadmin暴露了不安全
http://www.maoegg.com/centos6-yum-install-php-mysql-apache-php-extension/