CentOS6 Yum安装 php+mysql+apache+php扩展
默认安装完后发现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/