且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在带有CentOS 7的PHP 7.2上安装zipArchive?

更新时间:2023-11-10 12:22:28

php-json.x86_64 7.2.3-2.el7.remi @ remi-php72

php-json.x86_64 7.2.3-2.el7.remi @remi-php72

php72-php-json.x86_64 7.2.3-2.el7.remi @ remi-safe

php72-php-json.x86_64 7.2.3-2.el7.remi @remi-safe

看起来您的安装很乱,您已经安装了一半的 php- 软件包(基本软件包)和一半的 php72-php- (SCL程序包)

Looks like your installation is a mess, you have installed half of the php- packages (base packages) and half of the php72-php- (SCL packages)

阅读有关 PHP- *和php ##-php- *软件包之间的区别的常见问题解答. ?

php-fpm.x86_64 7.2.3-2.el7.remi @ remi-php72

php-fpm.x86_64 7.2.3-2.el7.remi @remi-php72

当您使用FPM作为 remi-php72 的基本软件包时,您需要来自同一存储库的zip扩展名(可能未启用,请使用yum repolist进行检查)

As you are using FPM as base package from remi-php72, you need zip extension from the same repository (which is probably not enabled, chech with yum repolist)

丢弃不需要的包

yum remove php72\*

向导所述,永久启用存储库以确保所有扩展将被拉走

As explained by the wizard, enable the repository permanently to ensure all extensions will be pulled from it

yum-config-manager --enable remi-php72
yum install php-pecl-zip

echo"extension = zip.so" >>/etc/php.d/zip.in

echo "extension=zip.so" >> /etc/php.d/zip.in

从不执行此操作,每个程序包都提供其配置文件以启用提供的扩展名.

Never do this, each package provides its configuration file to enable the provided extension.