tid=167&首先check linux是否安裝php-mcrypt module
7 ]- @4 b* U( e9 n ?* p- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝
2 R: \$ _0 c* F* H5 U但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
5 [$ P3 \2 Y3 b6 u. }. Jfor CentOS 6.x x86:
) n) F8 _& D; i2 {- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
% A- q8 G) y+ I3 H5 e, b - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm; l8 c- _( ` k9 z
- # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- J# A5 x6 E/ b/ R+ S - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
; p ]9 c/ |5 {- Bfor CentOS 6.x x64
% ]0 @- a4 n, t( {6 {- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm! |% t- ^: ?& j; R, @# a$ \
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm( q8 M7 E1 P! s) x
- # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
, k Y# t5 z: C. u( ~9 }4 G7 G - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是7 X3 }+ `! H; e8 [% F7 T
- # yum install php-mcrypt
5 D2 b* u: }9 q$ O& b, E6 Q, K9 C - Loaded plugins: fastestmirror, refresh-packagekit- `6 D2 V2 Y4 h% _6 H$ n' @
- Loading mirror speeds from cached hostfile. \9 o5 Q0 c: K+ @3 {9 V) _
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼
) V& g- a! u/ a2 E3 G1 f S. W! B* U0 u9 }0 n' X
於是
/ i" }6 j! p4 K6 j% A: S! c4 w# O- #vi etc/yum.repos.d/epel.repo
複製代碼
% a/ s& F7 W6 ]7 w將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
, T( j% t ~ ^. Y1 R6 D; Sbaseurl$ z3 E( d8 I$ `8 X$ D {
#mirrorlist
- J' V) C+ Z% k' X( |5 ~最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
# F; z: f0 N+ ?9 f" x7 Y& E3 W* b2 i( b- j
! g. e9 ]* j' Z* Z& _& m
4 h( B+ y) V3 l, {. V& p3 t$ O且apache需restart,php-mcrypt module才會發生作用 |