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
' P4 a  j6 T) p2 M
  1. #rpm -qa | grep php-mcrypt
複製代碼
若無則以yum安裝+ y5 M& y. P, f0 T6 b/ T
  1. #yum install php-mcrypt
複製代碼
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
: O' a" i1 J' M2 W* g9 L9 U# n
for CentOS 6.x x86:$ f2 t  N) U) Q# H
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
    6 ^) `4 A7 [5 B0 n, S5 N
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm, b* w; o; |, i4 c0 d4 P, u  X
  3. # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm* o2 I+ Y8 b6 {6 L2 h
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼

3 f. c; z/ e* ~, }" P$ v2 ^0 Dfor CentOS 6.x x64
+ L6 e3 h* a& B: ?' d; h( U" |
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
    2 y- n' \  ~" L
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm! P$ z' c- |# i" I
  3. # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    5 }/ I  s  |) b6 h4 W  P
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
再執行一遍 #yum install php-mcrypt,但這次出現的問題是
% o# X* F% y) i0 s: @9 e& H$ Z
  1. # yum install php-mcrypt
    9 n) b. Y/ a+ |( N6 }& C  Q
  2. Loaded plugins: fastestmirror, refresh-packagekit8 W: q% m- X' {2 E& O4 Y7 W: ~
  3. Loading mirror speeds from cached hostfile. {& q$ K( L* [0 K- c( I" ^
  4. Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼
7 K, {, I7 K/ P% d
: ^* t0 A7 @; k$ i
於是" n9 c* [+ A7 t: s9 j7 d
  1. #vi  etc/yum.repos.d/epel.repo
複製代碼
$ z. L, t1 @+ C) `1 n! T4 ^' N
將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
1 o4 v+ L# {2 d: O
baseurl7 V9 t& {, l" C* p. q
#mirrorlist! g( |+ g$ C6 _
最後再執行一遍
#yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組$ |  D9 G1 R) A& D& t% ^1 W* [3 T- V7 V

0 q8 H6 R7 n4 a$ A5 o& b
- o4 U; }! S) i- X, t# G. m

( L6 O) |. V5 Y且apache需restart,php-mcrypt module才會發生作用
  1. #service httpd restart
複製代碼





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