首先check linux是否安裝php-mcrypt module7 T, a/ X t/ ^# y; f& d
- #rpm -qa | grep php-mcrypt
複製代碼 若無則以yum安裝
; V, v2 n0 x3 Q( Q6 H但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
) d. y) }0 W5 _% n# cfor CentOS 6.x x86:$ R: \" f$ H, K- V2 I2 v
- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
1 I# w$ U( G( w5 S X& e/ g - # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm6 m. F$ W, x+ M2 E6 H/ R
- # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
! f' V+ x1 X. L2 R$ c; s - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
: o- k0 h& |2 Gfor CentOS 6.x x64
1 U3 d! e5 M5 |1 ~' q4 ^9 |+ a- # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm: y T3 c+ ?8 Y2 ?
- # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm2 C/ C: j; ^* j) z2 a
- # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
1 L8 i3 N- n) C! G5 ?' c3 F - # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼 再執行一遍 #yum install php-mcrypt,但這次出現的問題是
* m1 v' t0 _4 Y! h: r. i- # yum install php-mcrypt3 x- E6 _2 a" d9 T. Q, O, {
- Loaded plugins: fastestmirror, refresh-packagekit# w, W/ D5 r7 q7 e4 v7 T4 y
- Loading mirror speeds from cached hostfile% [3 S6 A9 T2 D6 c
- Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼 1 l. D% G' A* M$ b
- H' Y& H/ O9 z" j* q: v於是% D0 q3 T0 v; j2 S( `% c. @4 B
- #vi etc/yum.repos.d/epel.repo
複製代碼
* S* F4 b+ }2 z8 N5 C3 \將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:' J. p2 c9 ]5 p1 \
baseurl
" \3 y) I, F. i; i& V! p! V, n#mirrorlist, H' f- ` B0 L3 [/ \) H
最後再執行一遍 #yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組) v( b: G9 B1 `2 E4 ]) M* l
; Q* j! v2 ?% N' ]/ Z1 }
2 o, b, ?3 `% C, {
2 }5 A$ t+ I: J. ~# x( Z
且apache需restart,php-mcrypt module才會發生作用 |
|