在 CentOS 6 上安装 php-mcrypt

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17109818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:17:19  来源:igfitidea点击:

Install php-mcrypt on CentOS 6

phpcentos

提问by Scott Dawson

I have been trying to install php-mcrypt for a while now. Everytime I get the "No package php-mcrypt available." returned to me. Here's what I've tried:

我一直在尝试安装 php-mcrypt 一段时间了。每次我收到“没有可用的 php-mcrypt 包”时。回到我身边。这是我尝试过的:

root@ip-********** [~]# yum install php-mcrypt --enablerepo=centosplus (<- both with and without this)
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: p3plmirror01.prod.phx3.secureserver.net
* centosplus: p3plmirror01.prod.phx3.secureserver.net
* epel: mirrors.solfo.com
* extras: p3plmirror01.prod.phx3.secureserver.net
* updates: p3plmirror01.prod.phx3.secureserver.net
centosplus                                               | 3.5 kB     00:00
centosplus/primary_db                                    | 746 kB     00:00
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do

I have made sure to install the EPEL repository. At this point I'm just stumped. I've followed EVERY tutorial I've found online and get the same error.

我已经确保安装了 EPEL 存储库。在这一点上,我只是难住了。我已经按照我在网上找到的每个教程都得到了同样的错误。

Notes: Go DaddyVPS, CentOS6.4 64-bit, mcrypt installed without a hitch, but no php-mcrypt.

注意:Go Daddy VPSCentOS6.4 64 位,mcrypt 安装顺利,但没有 php-mcrypt。

采纳答案by Scott Dawson

I was able to figure this out; it was a lot simpler then I thought. Under the WHM manager go to: Home >> Software >> EasyApache (Apache Update) >> There you have two options "Build Profile" or "Customize Based On Profile". I went Customize to keep my current config then followed the instructions on the page.

我能够弄清楚这一点;这比我想的要简单得多。在 WHM 管理器下,转到:主页 >> 软件 >> EasyApache(Apache 更新)>> 您有两个选项“构建配置文件”或“基于配置文件自定义”。我去自定义以保留我当前的配置,然后按照页面上的说明进行操作。

Eventually there was a place to add and remove php modules. There you will find ever module under the sun. Just select the one you want and rebuild the profile. It was really that simple.

最终有一个地方可以添加和删除 php 模块。在那里你会发现阳光下的任何模块。只需选择您想要的一个并重建配置文件。真的就是这么简单。

回答by James Oravec

I had the same issue, and found the previous suggestions gave me enough info to get it working on my server. The following is what I did:

我遇到了同样的问题,发现之前的建议给了我足够的信息,让它在我的服务器上工作。以下是我所做的:

1) Install EPEL repository (From: http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x):

1)安装EPEL仓库(来自:http: //www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x ):

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

2) Install it via:

2)通过以下方式安装:

yum update
yum install php-mcrypt*

The yum updateupdated the repository reference on my server then the 2nd command got what I needed :)

yum update我的服务器上更新了库引用,则第二个命令得到了我所需要的:)

3) Restart your webserver. For my apache install I did:

3) 重新启动您的网络服务器。对于我的 apache 安装,我做了:

service httpd restart

回答by Compusam

For me the answer was:

对我来说,答案是:

1) Get the Repos from

1)从

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

2) Install it via:

2)通过以下方式安装:

sudo yum update
sudo yum install php-mcrypt*

3) Edit the mcrypt.ini

3) 编辑 mcrypt.ini

sudo nano /etc/php.d/mcrypt.ini

add this

添加这个

extension=/usr/lib64/php/modules/mcrypt.so

Finally 4) Restart your webserver:

最后 4) 重新启动您的网络服务器:

sudo service httpd restart

I run this steps in CentOS 6.3 (64) on Azure From Microsoft Linux image

我在来自 Microsoft Linux 映像的 Azure 上的 CentOS 6.3 (64) 中运行此步骤

Hope it helps you.

希望对你有帮助。

Best Regards.

此致。

回答by TylersSN

Updated Answer for centos 7

centos 7 的更新答案

 ## RHEL/CentOS 7 64-Bit ##
 # wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
 # rpm -ivh epel-release-7-0.2.noarch.rpm

For CentOS 6

对于 CentOS 6

 ## RHEL/CentOS 6 32-Bit ##
 # wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 # rpm -ivh epel-release-6-8.noarch.rpm

 ## RHEL/CentOS 6 64-Bit ##
 # wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
 # rpm -ivh epel-release-6-8.noarch.rpm

Install

安装

 yum install php-mcrypt

Edit: See comments for updated repositories.

编辑:查看更新存储库的评论。

回答by sariDon

yum install php-mcrypt.x86_64

worked for me instead of

为我工作而不是

yum install php-mcrypt

回答by Manoj Borah

I got too much problem in installing php-mcrypt using epel-release-6-8.noarch.rpm. It has some dependency problem.

我在使用 epel-release-6-8.noarch.rpm 安装 php-mcrypt 时遇到了太多问题。它有一些依赖性问题。

Then I tried in different way.

然后我尝试了不同的方式。

Get the php-mcrypt using "wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm" command.

使用“wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm”命令获取php-mcrypt 。

Then install libmcrypt

然后安装 libmcrypt

ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm

ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm

The installed php-mcrypt using following command

使用以下命令安装的 php-mcrypt

yum install php-mcrypt-5.3.3-3.el6.x86_64.rpm

回答by user2599431

If php_mcrypt installed on 64bit but reported missing by an installer, check the extension path:

如果 php_mcrypt 安装在 64 位,但安装程序报告丢失,请检查扩展路径:

vi /etc/php.d/mcrypt.ini

vi /etc/php.d/mcrypt.ini

; Enable mcrypt extension module
;extension=module.so
extension=/usr/lib64/php/modules/mcrypt.so
; Enable mcrypt extension module
;extension=module.so
extension=/usr/lib64/php/modules/mcrypt.so

回答by Gregory Marsh

To install mcrypt from http://namhuy.net/641/centos-6-install-mcrypt-for-phpmyadmin.html

http://namhuy.net/641/centos-6-install-mcrypt-for-phpmyadmin.html安装 mcrypt

i386

i386

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

x86_64

x86_64

http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

then just use yum command to install the mcrypt package

然后只需使用 yum 命令安装 mcrypt 包

yum install php-mcrypt

回答by Dimitrios

The best way is to:

最好的方法是:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
yum localinstall php-mcrypt-5.3.3-3.el6.x86_64.rpm

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm
yum localinstall libmcrypt-2.5.8-9.el6.x86_64.rpm

or go to: http://dl.fedoraproject.org/pub/epel/6/x86_64/to match your version check from your info.php that is ok -- done!

或访问:http: //dl.fedoraproject.org/pub/epel/6/x86_64/以匹配您的 info.php 中的版本检查 - 完成!

回答by Filippos Karapetis

There are two ways you can address this:

有两种方法可以解决这个问题: