在 CentOS 6 上安装适用于 php 7.3 的 php 扩展

在 CentOS 6 上安装适用于 php 7.3 的 php 扩展

我用过了,

 yum install php-pecl-zip

我收到以下错误,

Loaded plugins: fastestmirror, replace
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.mirror.snu.edu.in
 * epel: epel.dionipe.id
 * extras: centos.mirror.snu.edu.in
 * updates: centos.mirror.snu.edu.in
 * webtatic: uk.repo.webtatic.com
http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/repodata/repomd.xml: [Errno 14] Downloaded more than max size for https://www.mongodb.com/: 113752 > 102400
Trying other mirror.
Resolving Dependencies
--> Running transaction check
---> Package php71w-common.x86_64 0:7.1.33-1.w6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                    Arch                                Version                                     Repository                             Size
========================================================================================================================================================================
Installing:
 php71w-common                              x86_64                              7.1.33-1.w6                                 webtatic                              1.2 M

Transaction Summary
========================================================================================================================================================================
Install       1 Package(s)

Total size: 1.2 M
Installed size: 8.5 M

Transaction Check Error:
      file /etc/php.ini from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php-zts/modules/bz2.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php/modules/bz2.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php-zts/modules/calendar.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php/modules/calendar.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php-zts/modules/ctype.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64
      file /usr/lib64/php/modules/ctype.so from install of php71w-common-7.1.33-1.w6.x86_64 conflicts with file from package php-common-7.3.12-1.el6.remi.x86_64

我的PHP版本php -v如下,

PHP 7.3.12 (cli) (built: Nov 19 2019 12:37:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies

epel repo 如下,

Installed:
  epel-release.noarch 0:6-8

安装 php-zip 扩展时我的服务器出现了什么问题?

答案1

以下命令解决了我的问题。

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-6.rpm

sudo yum -y install yum-utils

sudo yum-config-manager --enable remi-php73

sudo yum update

sudo yum install php-pecl-zip

php --modules

service httpd restart

相关内容