如何在 CentOS 5 服务器上安装 PHP MCrypt + 库 (libmcrypt)

如何在 CentOS 5 服务器上安装 PHP MCrypt + 库 (libmcrypt)

我正在尝试在我的服务器上安装 mCrypt for PHP,在此之前我发现我还需要安装 libmcrypt...

不幸的是,我无法通过谷歌找到任何真正适用于此的说明。

我最初只是尝试了一下,yum install php-mcrypt但我得到了No package php-mcrypt available.- 所以我认为这是因为我还没有安装 libmcrypt?

谢谢!

回购清单:

$ yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.cogentco.com
 * epel: mirror.cogentco.com
 * extras: centos.aol.com
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.ash.fastserv.com
repo id      repo name                                           status
base         CentOS-5 - Base                                     enabled:  3,535
epel         Extra Packages for Enterprise Linux 5 - x86_64      enabled:  6,642
extras       CentOS-5 - Extras                                   enabled:    299
rpmforge     RHEL 5 - RPMforge.net - dag                         enabled: 10,695
updates      CentOS-5 - Updates                                  enabled:    765
repolist: 21,936

我已经取得了一些进展..库已成功安装。但是 mcrypt 在依赖项上存在一些错误:

Running Transaction
  Installing     : php-common                                               1/5 
warning: /etc/php.ini created as /etc/php.ini.rpmnew
  Installing     : php-cli                                                  2/5 
  Installing     : httpd                                                    3/5 
Error unpacking rpm package httpd-2.2.3-45.el5.centos.1.x86_64
warning: /etc/httpd/conf/httpd.conf created as /etc/httpd/conf/httpd.conf.rpmnew
warning: /etc/httpd/conf/magic created as /etc/httpd/conf/magic.rpmnew
error: unpacking of archive failed on file /etc/httpd/logs: cpio: rename
  Installing     : php                                                      4/5 
  Installing     : php-mcrypt                                               5/5 

Installed:
  php-mcrypt.x86_64 0:5.1.6-15.el5.centos.1                                     

Dependency Installed:
  php.x86_64 0:5.1.6-27.el5_5.3            php-cli.x86_64 0:5.1.6-27.el5_5.3    
  php-common.x86_64 0:5.1.6-27.el5_5.3    

Failed:
  httpd.x86_64 0:2.2.3-45.el5.centos.1                                          

Complete!

MIKE 的更新

[root@server ~]# fuser -k 80/tcp
80/tcp:              17496 17502 17503 17504 17505 17590
[root@server ~]# service httpd restart
httpd not running, trying to start
[root@server ~]# service httpd status

Looking up localhost
Making HTTP connection to localhost
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://localhost/whm-server-status'
Alert!: Unable to access document.

lynx: Can't access startfile 

此外,这是在 apache 错误日志中:

[Sat Aug 20 16:59:33 2011] [error] (13)Permission denied: Cannot open SSLSessionCache DBM file `/usr/local/apache/logs/ssl_scache' for writing (store)

答案1

在我看来你的 /etc/httpd/logs 不再是一个符号链接

ls -lsd /etc/httpd/logs

应该指出的是

/var/log/httpd

编辑

从你的评论来看,它不再是一个符号链接

mv /etc/httpd/logs /etc/httpd/logs.bak
ln -s /var/log/httpd /etc/httpd/logs
service httpd restart

然后尝试 yum 更新

答案2

通过安装这些 rpm 包,您严重弄乱了“cPanel”服务器 apache + php。在 cPanel 中,您需要使用 easyapache 编译 apache 和 php 以启用其他模块(easyapache 脚本中的一切都很方便,您只需选择相应的包)。cPanel 使用自定义 apache 和 php 构建网站,您需要以 cPanel 方式执行此操作。我假设您删除了 yum.conf 中的排除列表以实现这些安装。要恢复您的服务器,

  1. 卸载您安装的 apache 和 php rpm。
  2. 运行 eachyapache 并选择必要的模块,以重新启动 apache。

您可以从命令行运行 easyapache 脚本(在屏幕上运行会很好)

**/scripts/easyapache**

或者可以使用 WHM 重新编译您的 apache + php。另外,请确保将排除列表放回到 yum.conf 中,以防止这种情况再次发生。

exclude=apache* bind-chroot courier* dovecot* exim* filesystem httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*

对于 EasyApache 文档:http://docs.cpanel.net/twiki/bin/view/EasyApache3/

-$

答案3

安装雷米或者原子回购并再试一次。

相关内容