首先check linux是否安裝php-mcrypt module
0 c- b- x2 d; W0 H3 _# L. a- g- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝7 ?$ j$ u2 r# k- Y# @
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
9 U/ p; k% I# c- ofor CentOS 6.x x86:
3 Y# Z/ g( r8 U4 t/ P6 R- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
/ A% n9 u4 _. f" ^0 W0 u( C - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
7 g0 k# j+ j5 ]1 i, O - # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
" i6 J$ _3 b4 i- @& k - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 ' E* z/ \! \6 p
for CentOS 6.x x64& r- _& x4 A2 ?4 J
- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm: g/ V( ^7 [* y6 A! `
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
1 \2 n4 ^1 d" y* o9 Y3 q! r - # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
, \3 b& V- @( L( o; b - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是; z. _. e- W% H d1 a
- # yum install php-mcrypt7 j+ P+ l4 ^' n. L, d& G
- Loaded plugins: fastestmirror, refresh-packagekit2 ?6 f6 h) D, b! U5 ^& N* W
- Loading mirror speeds from cached hostfile
, P1 [* T3 `5 P4 v - Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼 * p& I% ?- P1 ]+ m
% v( u/ w+ K. n於是# H7 v3 t- z/ P6 S% h& i
- #vi etc/yum.repos.d/epel.repo
複製代碼
# K6 |# J p6 n2 B4 M+ X將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:/ ^! d+ e. D0 \% V" N7 N3 z
baseurl- _) `5 F# A# B+ Y* [# h/ P
#mirrorlist
& t# B# z2 i" g: w) v: A8 {4 i# O( J最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組7 ^! h7 b ^3 {' P
6 ?) E: z: t1 K _( I
; S+ W2 e0 O5 w$ D) T/ H5 y5 U
' H- i) Z; a6 s且apache需restart,php-mcrypt module才會發生作用 |
|