首先check linux是否安裝php-mcrypt module. g& W+ b2 I* p. N7 Y3 b
- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝0 Y- x& h* Z% o/ s# _
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
2 V4 j' r& @+ M' ^, xfor CentOS 6.x x86:
( W, o: z M5 p- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm, E$ {- f# l$ |% Y7 ?/ z
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm& L9 z1 W1 I) m5 e3 |
- # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm" G. K$ G0 y6 A9 G* X
- # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
! J: N0 Z1 G$ y& |& k" bfor CentOS 6.x x64
: B! [* B# f( }- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
! R% b& s8 A+ m& ?6 U* z8 j7 v( u) g - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
$ }3 g! s& u# l. v: a1 `) D6 Q - # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2 F2 W* D8 g2 d0 j3 p# e1 v l - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是$ x; g' C' g9 u* n
- # yum install php-mcrypt
/ L) c* m+ u" A6 i, p% U - Loaded plugins: fastestmirror, refresh-packagekit
2 Q6 w. z6 k2 Y: G6 _/ S; g7 i, S2 G - Loading mirror speeds from cached hostfile
0 d9 L* L* j5 ^7 K! N - Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼 3 L0 x# A0 M+ N# r
4 P2 z$ j3 h( r7 I7 ~3 \8 V
於是2 P3 Z* m) l6 ^/ Y6 E
- #vi etc/yum.repos.d/epel.repo
複製代碼
8 k7 I: @0 u( s/ ~7 R將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:& A1 z( V$ X9 Q5 Y; d4 s
baseurl# S1 R$ j" U( j
#mirrorlist
% e) e: E6 \! N* V最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
+ y1 r( g! N E: a8 [ g$ h
7 _* y! P2 J- g: {* l/ |5 S2 d
$ Q# |7 Q7 L3 `( h5 }. z& g) n% n7 _- k0 u6 T8 ~4 t
且apache需restart,php-mcrypt module才會發生作用 |
|