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
% W$ k6 b( B* o' z/ a0 p6 B- z
  1. #rpm -qa | grep php-mcrypt
複製代碼
若無則以yum安裝
0 a2 G' P) t' g5 F* D8 {  H
  1. #yum install php-mcrypt
複製代碼
但它會提示說無php-mcrypt可供安裝,於是執行下列動作:
9 k' t( z/ ]8 g3 v7 }6 y& M
for CentOS 6.x x86:
0 D, c7 \7 m1 t
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
    3 i  `8 D! B2 q* w9 q) m
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
    0 j2 e& E2 A* _% A  ?' k
  3. # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
      a" N$ x1 g2 L5 f7 K
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
# b) f5 P' B& P9 g9 n
for CentOS 6.x x64; N" I: [$ P9 t/ T8 B* r
  1. # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
    $ \% ~( h4 w1 t0 C
  2. # rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
    + M9 Z0 [3 d" O+ t2 Q6 ^1 {. R4 z
  3. # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    8 }, O' z4 e. ?  y( @, I7 S
  4. # rpm -ivh epel-release-6-8.noarch.rpm
複製代碼
再執行一遍 #yum install php-mcrypt,但這次出現的問題是6 Y: p" q' C# d8 e; i
  1. # yum install php-mcrypt4 n/ e9 P& @7 E- n9 _# A* T8 v; V  ~
  2. Loaded plugins: fastestmirror, refresh-packagekit% W2 ^; W0 R: x0 {. t) r! \0 z  j/ A
  3. Loading mirror speeds from cached hostfile+ K& Y- M# U/ m, K: \9 r* R
  4. Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
複製代碼
* R6 N4 y% U. `, Q

0 f  y' E* h1 t於是
& ~2 G( v3 O& w2 T# }
  1. #vi  etc/yum.repos.d/epel.repo
複製代碼
. [% n* l$ |8 |8 b, P/ o
將[epel]段下的 baseurl註解掉,並將mirrorlist恢復,如下:
7 N& x0 l. G1 W+ |, b2 l
baseurl/ ^+ }2 T4 s! G- c  `
#mirrorlist
9 }8 _) s# a' \" S  c+ Q) y& G最後再執行一遍
#yum install php-mcrypt,這次終於順利安裝完成,會看到安裝如下的模組' Z4 z) h8 H2 W2 j: M# x2 |0 D

% T% b- E7 _( i8 }& n! e 2 `& H3 u0 p5 L  b

. x  [/ J7 A2 K( h2 T且apache需restart,php-mcrypt module才會發生作用
  1. #service httpd restart
複製代碼





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