PHP 错误:“zip 扩展名和解压缩命令都丢失,正在跳过."扩展名、跳过、命令、错误

2023-09-07 08:55:56 作者:青春喂了作业

当我运行 composer update 时,我收到以下错误消息:

When I run a composer update I get this error message:

Loading composer repositories with package information
Updating dependencies (including require-dev)
    Failed to download psr/log from dist: The zip extension and unzip command are both missing, skipping.
The php.ini used by your command-line PHP is: /etc/php/7.0/cli/php.ini
    Now trying to download from source

我需要做什么来启用 zip 和 unzip 命令,以便 composer 可以下载依赖项?

What do I need to do to enable the zip and unzip commands so that composer can download dependencies?

推荐答案

根据您的 Linux 风格和 PHP 版本,这些可能会有所不同.

Depending on your flavour of Linux and PHP version these may vary.

(sudo) yum install zip unzip php-zip
(sudo) apt install zip unzip php-zip

这是一个非常常见的问题,您可以通过搜索 <distro> 在以太中找到更多有用的信息.php 邮编扩展.

This is a very commonly asked question, you'll be able to find more useful info in the aether by searching <distro> php <version> zip extension.