tid=167&首先check linux是否安裝php-mcrypt module( P( p7 P. O$ ^# H W2 m
- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝
1 I5 I0 v, t0 A2 h D2 X但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
) x) |3 P4 ?* [0 A9 q) m" Rfor CentOS 6.x x86:
7 x+ W# L9 S- W. i2 j& Q- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm% L, K+ h1 C c& f
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
7 \; M1 I6 a& Q - # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
: `' l& S- q5 P+ t+ M7 u7 k8 a - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
# e" Q. U, W& S* ^" Afor CentOS 6.x x64
1 D" D0 L3 O! R5 M6 S) L( Q- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# S$ d2 p+ T0 g1 \0 c0 u( o - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm) j- [+ W8 ~ n
- # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
/ ~. a$ k2 |8 {+ e2 Z( o - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是 F3 x- ^) f2 r' S( T4 F/ c+ L
- # yum install php-mcrypt- y& Y6 Z8 Q8 y+ `$ T) O
- Loaded plugins: fastestmirror, refresh-packagekit, `# A9 S4 _% l
- Loading mirror speeds from cached hostfile
, J; t3 G) v, Y% ] - Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼
( t. J% E3 {& f7 a0 _" v& N( ?7 |* `( f. L P: u$ f, X* A
於是+ k. [" l" U8 K; `3 F# `! j
- #vi etc/yum.repos.d/epel.repo
複製代碼
0 Z% y2 s' i$ R) n! U將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
4 F5 X* M0 T0 h6 m% s7 wbaseurl
0 d- ]/ n4 C$ O" M; Y% r#mirrorlist0 {. @# N0 E% \) ?1 w
最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組: v" E. G, I- u% c7 n. C) L% N
0 I; _0 T( `6 _9 ~5 ?) O
: m2 R2 A! T; q x! w% U# F
0 ^0 h* N9 z S9 F/ Q0 V$ S. ~( z
且apache需restart,php-mcrypt module才會發生作用 |