首先check linux是否安裝php-mcrypt module
# G) C, s3 Q* a% E2 W+ D- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝7 Q. h# I P. d0 f+ I
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:, H! E" j, R- \, j: \ v1 k5 j
for CentOS 6.x x86:
" ^$ A4 y; G( P! U8 s V# H& x- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
6 t, C, _% d" h- v5 b. _/ w - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
1 c. h8 F# f& P6 y - # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
( o! _+ B2 L/ _9 a; e4 p% X - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 9 v1 p. U* B4 U5 i
for CentOS 6.x x643 X$ ?" r4 U1 a: H# E) G
- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm# u' h5 `1 H, U+ X* M
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm8 m. z# s4 M; V- `
- # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm) M! }+ y& B) _" _2 s
- # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是
& `& J0 T0 ]2 m: o9 ~* R" j0 N4 Z( d- # yum install php-mcrypt1 f/ J$ J$ A& d; Z2 d8 V+ C
- Loaded plugins: fastestmirror, refresh-packagekit
, R' `* u6 \! ^7 K6 h, W# O - Loading mirror speeds from cached hostfile3 i% y9 g) z$ a! K2 C
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼 ; o/ D8 I( u& X6 F4 _! H
, Y% E+ i6 ~9 z4 r H7 k7 `於是5 ?7 G' P$ l ^% q
- #vi etc/yum.repos.d/epel.repo
複製代碼
5 M( h% s: K$ E# d4 e; F! |將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:0 j4 M& _# I! [1 O/ c! K
baseurl
. T. \8 u5 E5 v* b# |! e" L#mirrorlist
) B6 f2 g# P$ S6 Z1 h+ m( ^% p最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
( Q5 p$ E5 y. `# e' Z- g, m# k! O M o( a0 B3 a
' T, X+ u! l) `* X
/ ^6 p. S x5 z9 O. P且apache需restart,php-mcrypt module才會發生作用 |
|