tid=167&首先check linux是否安裝php-mcrypt module: p" p A# W% E) N" I/ v
- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝6 l {) d7 U e
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:1 m+ s' c4 V: w, ^
for CentOS 6.x x86:
( r! D f6 V" ?5 c0 X0 z- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm( ~ |0 G; H& w6 f
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm7 z9 y$ k! Q5 |* E' n" w3 D
- # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
( Y8 A& c% e' m" o+ C8 m - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
. v* ?0 L7 V, G- [- afor CentOS 6.x x64
$ p8 y9 E8 G/ b. w$ d- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# V4 x: i$ k# z: V/ v5 P( Z4 ]. G4 ]' ^ - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
) j8 X' t3 N! b8 f0 s6 A' s0 k1 E - # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm6 q% o& c$ N* n+ U- L6 Y
- # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是7 J# g F5 d7 p2 p! S
- # yum install php-mcrypt O: V$ e+ x4 S* l* z1 [" V
- Loaded plugins: fastestmirror, refresh-packagekit; ^8 i1 e* @: l& i4 N; _: m
- Loading mirror speeds from cached hostfile
$ ]. a! G# `8 { - Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼
" m: v H. t* d. E
l+ B/ g0 p! V3 {7 i3 w於是6 e4 `6 @$ s8 p+ R$ o7 v- t$ F
- #vi etc/yum.repos.d/epel.repo
複製代碼
4 K# `" E- p% K: e將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
, r2 H1 v/ f% v5 D* ?- wbaseurl
% j$ \6 @6 o& a$ {) e- d#mirrorlist
1 U" p% @% c/ I+ T* i$ K; W最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組' i3 \- y" v; \! y
7 H) P5 h" |; E7 F Q8 `
3 W, G- B# r/ _) w
8 v# x) M8 G. k' u! p/ z且apache需restart,php-mcrypt module才會發生作用 |