在linux下以yum安裝mcrypt(php-mcrypt)
首先check linux是否安裝php-mcrypt module#rpm -qa | grep php-mcrypt若無則以yum安裝
#yum install php-mcrypt但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
for CentOS 6.x x86:
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
for CentOS 6.x x64
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm再執行一遍 #yum install php-mcrypt,但這次出現的問題是
# yum install php-mcrypt
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
於是
#vietc/yum.repos.d/epel.repo
將段下的 baseurl註解掉,並將mirrorlist恢復,如下:
baseurl
#mirrorlist
最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
且apache需restart,php-mcrypt module才會發生作用#service httpd restart
頁:
[1]