52AV手機A片王|52AV.ONE

標題: 在linux下以yum安裝mcrypt(php-mcrypt) [打印本頁]

作者: IT_man    時間: 2014-12-11 22:13
標題: 在linux下以yum安裝mcrypt(php-mcrypt)
首先check linux是否安裝php-mcrypt module
/ [+ V- Z/ Y$ H
  1. #rpm -qa | grep php-mcrypt
複製代碼
若無則以yum安裝
2 o8 h1 o0 `2 Y; Q6 H! k: I
  1. #yum install php-mcrypt
複製代碼
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
, G! t2 D/ t1 q
for CentOS 6.x x86:" B; S. U+ V4 o& r, A/ `9 @( c9 x
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm+ n- k1 b* J0 ^* v( H4 q- r
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
    ( i! M( l* G9 E7 l; h0 x$ {; j
  3. # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm* C) N) w! ~/ p$ {0 a* ]
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
0 y# O- c* m( J& b1 e1 m5 Q  E5 @6 W
for CentOS 6.x x64
4 M* V# u4 Z5 [+ F) |+ M
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm% U3 V. Q' O8 t- X
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm! S; ]) X% z8 G# G0 \) L3 M
  3. # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    . N' C, z1 l+ T! a8 T( a
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
再執行一遍 #yum install php-mcrypt,但這次出現的問題是
9 |" b$ w9 [5 D
  1. # yum install php-mcrypt( g: N' c" H& a4 ?
  2. Loaded plugins: fastestmirror, refresh-packagekit  p$ C( s2 y5 M, @4 Z. C( {" _
  3. Loading mirror speeds from cached hostfile3 \& N/ ^. j1 s5 ^; J" b- G& w
  4. Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼

0 B. c  O$ z3 w6 c7 {
( Y$ K' K, r+ D! w+ ]. `
於是
2 A/ A4 N+ `* Y7 z" X+ {
  1. #vi  etc/yum.repos.d/epel.repo
複製代碼

: J8 p9 x, H% x6 d$ u. H
將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
6 k7 C2 a$ w1 S7 R- ]
baseurl2 [5 z. a; D( C
#mirrorlist
0 ]% J& g/ d9 C& W9 T% [最後再執行一遍
#yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組
+ {; a7 n& d) ^8 I+ U' b; P
" f$ M6 E1 j" w' B5 b6 u

3 I5 p; ?+ ]" i. g4 M

( `) i& P% p1 Z. @2 r* `且apache需restart,php-mcrypt module才會發生作用
  1. #service httpd restart
複製代碼





歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/) Powered by Discuz! X3.2