无法安装作曲家

无法安装作曲家
curl -sS https://getcomposer.org/installer | sudo php -- --install- dir=/usr/local/bin --filename=composer 

当我在终端运行上述命令时,我得到了以下响应:

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The json extension is missing.
Install it or recompile php without --disable-json

The phar extension is missing.
Install it or recompile php without --disable-phar

The iconv OR mbstring extension is required and both are missing.
Install either of them or recompile php without --disable-iconv

答案1

在 Ubuntu 16.04 及更高版本中,可以从默认的 Ubuntu 存储库安装 Composer。打开终端并输入:

sudo apt install composer  

此命令还将同时安装所需的 PHP 和 JSON 依赖包。Composer PHP 依赖管理器可帮助您声明、管理和安装 PHP 项目的依赖项,确保您在任何地方都有正确的堆栈。

相关内容