在 PHP 5.4 CentOS 上安装 imap

在 PHP 5.4 CentOS 上安装 imap

我的系统是:

  • Centos 6.6,
  • 带有 php-fpm 的 Nginx 1.8.0,
  • PHP 版本 5.4.43,

我尝试安装 IMAP,yum install php5-imap但找不到包:

[root@nv-datacenter ~]# yum install php5-imap^C
[root@nv-datacenter ~]# yum install php5-imap
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.usf.edu
 * epel: mirror.steadfast.net
 * extras: mirror.5ninesolutions.com
 * remi-safe: mirrors.mediatemple.net
 * rpmforge: mirror.team-cymru.org
 * updates: mirrors.centarra.com
No package php5-imap available.
Error: Nothing to do

使用yum install php-imap命令时,出现 PHP 版本不匹配错误:

[root@nv-datacenter ~]# yum install php-imap
Loaded plugins: fastestmirror, priorities
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.liquidweb.com
 * epel: mirror.steadfast.net
 * extras: mirror.5ninesolutions.com
 * remi-safe: mirrors.mediatemple.net
 * rpmforge: mirror.team-cymru.org
 * updates: mirrors.centarra.com
Resolving Dependencies
--> Running transaction check
---> Package php-imap.x86_64 0:5.3.3-46.el6_6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-46.el6_6 for package: php-imap-5.3.3-46.el6_6.x86_64
...
Error: Package: php-imap-5.3.3-46.el6_6.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-46.el6_6
           Installed: php-common-5.4.43-1.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.43-1.el6.remi
           Available: php-common-5.3.3-40.el6_6.x86_64 (base)
               php-common(x86-64) = 5.3.3-40.el6_6
           Available: php-common-5.3.3-46.el6_6.x86_64 (updates)
               php-common(x86-64) = 5.3.3-46.el6_6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

有什么建议么?

答案1

试试这个;

yum install php54-php-imap

从我的 x64 盒子中搜索我得到以下内容:

Available Packages
Name        : php54-php-imap
Arch        : x86_64
Version     : 5.4.44
Release     : 1.el6.remi
Size        : 58 k
Repo        : remi
Summary     : A module for PHP applications that use IMAP
URL         : http://www.php.net/
License     : PHP
Description : The php54-php-imap module will add IMAP (Internet Message Access Protocol)
            : support to PHP. IMAP is a protocol for retrieving and uploading e-mail
            : messages on mail servers. PHP is an HTML-embedded scripting language.

Remi 使用以下名称来表示其 PHP 版本;

php54-php-foo - php 5.4
php55-php-foo - php 5.5
php56-php-foo - php 5.6

foo您想要的包名称在哪里。

看到你的评论可在此处直接下载还有一件事需要检查- /etc/yum.repos.d/remi.repo(或者无论您的版本叫什么)并检查您是否有以下几行以及启用了哪些内容。

[remi-php56]
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/php56/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
gpgkey=http://rpms.famillecollet.com/RPM-GPG-KEY-remi

相关内容