tid=167&首先check linux是否安裝php-mcrypt module
7 F( f( k1 |) e; ]( S' |, p3 k7 I: ?- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝
' D9 P; z4 Y" F- _; F但它會提示說無php-mcrypt可供安裝,於是執行下列動作:, n9 d o& N3 R0 K
for CentOS 6.x x86:+ w) x5 @& t' n' R7 W
- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
; F/ K3 \' B2 F! d: E) B - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm: H i0 l2 u/ y) c/ D
- # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
4 x( K$ h7 G; D( z& [+ q - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 % y3 Z0 ~1 Z' A& @& s8 Z
for CentOS 6.x x64# M' l* e7 s# z$ t( I7 X N7 F1 u; a
- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
" b6 @8 d/ K) y# ~ - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
7 J! o0 b7 b1 p3 l8 b3 {2 f4 B - # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm. ?/ B; R9 w! o ~4 b( Z
- # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是# b5 J% P* w* F! o9 n8 P5 w
- # yum install php-mcrypt: U5 H2 C8 c$ B; o
- Loaded plugins: fastestmirror, refresh-packagekit' c/ Q0 ^- A/ `) ~7 N4 n2 v# n& J8 U
- Loading mirror speeds from cached hostfile
. M$ d3 G+ u. B" F; B4 X. o - Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼 : k1 w' U5 ?* N4 l
8 u1 J8 t- t3 } g' [" b* p於是
c5 b9 |( g( B- #vi etc/yum.repos.d/epel.repo
複製代碼 + r! p5 {7 f/ o7 P' X0 o) C
將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:* ?: _! D5 [7 C7 m2 D3 @
baseurl8 h u7 ` a. N- Q+ f8 J
#mirrorlist6 L% T& S& L( J4 X# k
最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
. w/ \1 E9 L( k* F7 R3 c: Z
$ @. v" ~8 A" W
- G+ l. S& a7 a4 J1 X% T0 v1 t! r: c* y4 Z' ?6 \, u5 z
且apache需restart,php-mcrypt module才會發生作用 |