【问题标题】:CentOS 7 cannot install php-imap extensionCentOS 7 无法安装 php-imap 扩展
【发布时间】:2021-05-26 16:54:18
【问题描述】:

我正在尝试使用 PHP 7.2.23 版在 CentOS 7 服务器上安装 imap 扩展。我尝试了命令yum install php-imap,输出为

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                              |  21 kB  00:00:00
 * base: mirrors.vangus.co.il
 * epel: mirror.de.leaseweb.net
 * extras: mirror.ratiokontakt.de
 * remi-php72: mirror.23media.com
 * remi-safe: mirror.23media.com
 * updates: mirror.fra10.de.leaseweb.net
base                                                                                                              | 3.6 kB  00:00:00
epel                                                                                                              | 4.7 kB  00:00:00
extras                                                                                                            | 2.9 kB  00:00:00
mariadb                                                                                                           | 3.4 kB  00:00:00
remi-php72                                                                                                        | 3.0 kB  00:00:00
remi-safe                                                                                                         | 3.0 kB  00:00:00
updates                                                                                                           | 2.9 kB  00:00:00
(1/2): epel/x86_64/updateinfo                                                                                     | 1.0 MB  00:00:00
(2/2): epel/x86_64/primary_db                                                                                     | 6.9 MB  00:00:00
No package php-imap available.
Error: Nothing to do

所以我搜索了一下,发现我们可以从 epel 存储库安装。所以我运行了命令yum list *imap*,我得到了

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vangus.co.il
 * epel: mirror.de.leaseweb.net
 * extras: mirror.ratiokontakt.de
 * remi-php72: mirror.23media.com
 * remi-safe: mirror.23media.com
 * updates: mirror.fra10.de.leaseweb.net
Available Packages
cyrus-imapd.x86_64                                              2.4.17-15.el7                                                        base
cyrus-imapd-devel.i686                                          2.4.17-15.el7                                                        base
cyrus-imapd-devel.x86_64                                        2.4.17-15.el7                                                        base
cyrus-imapd-utils.x86_64                                        2.4.17-15.el7                                                        base
imapfilter.x86_64                                               2.6.15-1.el7                                                         epel
imapsync.noarch                                                 1.727-1.el7                                                          epel
imaptest.x86_64                                                 20151005-1.el7                                                       epel
offlineimap.noarch                                              6.7.0-1.el7                                                          epel
perl-Mail-IMAPClient.noarch                                     3.37-1.el7                                                           epel
python-abimap-doc.noarch                                        0.3.1-3.el7                                                          epel
python36-abimap.noarch                                          0.3.1-3.el7                                                          epel
up-imapproxy.x86_64                                             1.2.8-0.12.20171022svn14722.el7                                      epel
uw-imap.x86_64                                                  2007f-16.el7                                                         epel
uw-imap-devel.x86_64                                            2007f-16.el7                                                         epel
uw-imap-static.x86_64                                           2007f-16.el7                                                         epel
uw-imap-utils.x86_64                                            2007f-16.el7                                                         epel

如何为 PHP 安装 imap 扩展?请帮忙。

【问题讨论】:

  • 你是如何安装 epel repo 的? yum install epel?
  • @RamanSailopal 它已经在那里了。

标签: php centos centos7 php-7.2


【解决方案1】:

使用正确的配置,根据wizard 说明,安装应该可以工作

# dnf install php-imap
Dependencies resolved.
====================================================================================================================================================================================
 Package                     Arch                Version                     Repository                 Size
====================================================================================================================================================================================
Installing:
 php-imap                    x86_64              7.2.34-4.el7.remi           remi-php72                       89 k
Installing dependencies:
 libc-client                 x86_64              2007f-16.el7                epel                                      562 k

Transaction Summary
====================================================================================================================================================================================
Install  2 Packages

Total download size: 651 k
Installed size: 1.7 M
Is this ok [y/N]: 
  • 基地:mirrors.vangus.co.il
  • epel:mirror.de.leaseweb.net
  • 附加:mirror.ratiokontakt.de
  • remi-php72: mirror.23media.com
  • remi-safe:mirror.23media.com
  • 更新:mirror.fra10.de.leaseweb.net

嗯...看起来不错

php-imap 存在,应该可以找到

请检查启用 yum 的插件,或尝试使用 --noplugins 选项

另请注意,PHP 7.2 已于 2020 年 11 月结束生命周期,因此您应该考虑使用supported version

【讨论】:

  • 谢谢,但yum install --noplugins php-imap 没用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-04-28
  • 1970-01-01
  • 2016-09-29
  • 1970-01-01
  • 2021-01-03
  • 2019-02-14
  • 2015-12-31
相关资源
最近更新 更多