运行 composer 安装失败 laravel 7

Failed to run composer to install laravel 7

你好,我在这里发现了一个问题,我无法 运行 作曲家,我收到以下错误:

Error when performing composer installation

Do not run Composer as root / superuser! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from the lock file
Your requirements could not be resolved for an installable set of packages.

Issue 1
- Installation request for hashids / hashids 4.0.0 -> satisfactory for hashids / hashids [4.0.0].
- hashids / hashids 4.0.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 2
- Request for installation of laravel / framework v7.4.0 -> satisfactory for laravel / framework [v7.4.0].
- laravel / framework v7.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 3
- Installation request for lcobucci / jwt 3.3.1 -> satisfactory by lcobucci / jwt [3.3.1].
- lcobucci / jwt 3.3.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 4
- Request for installation of the alloy / common brand 1.3.2 -> satisfactory by the alloy / common brand [1.3.2].
- league / commonmark 1.3.2 requires ext-mbstring * -> the requested mbstring PHP extension is missing from your system.
Issue 5
- Request for installation of the facade / ignition 2.0.2 -> satisfactory for the facade / ignition [2.0.2].
- facade / ignition 2.0.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 6
- Request to install phpunit / phpunit 8.5.3 -> satisfactory by phpunit / phpunit [8.5.3].
- phpunit / phpunit 8.5.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 7
- Request to install the scrivo / highlighted.php v9.18.1.1 -> satisfactory by the scrivo / highlighted.php [v9.18.1.1].
- scrivo / highlighted.php v9.18.1.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
Issue 8
- laravel / framework v7.4.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing on your system.
- facade / flare-client-php 1.3.2 requires lighting / pipeline ^ 5.5 | ^ 6.0 | ^ 7.0 -> satisfactory by laravel / framework [v7.4.0].
- Installation request for facade / flare-client-php 1.3.2 -> satisfactory for facade / flare-client-php [1.3.2].


You can also run `php --ini` inside the terminal to see which files are used by PHP in CLI mode.

有谁知道如何告诉我哪里出错了?我该如何解决这个问题?

Laravel 7 需要以下 php 个模块

  • php-zip
  • php-mysql
  • php-mcrypt
  • php-xml
  • php-mbstring

使用以下代码在 fedora/centos/rhel 上安装它们。这将仅安装缺少的模块,

yum --enablerepo=remi,epel install php-zip php-mysql php-mcrypt php-xml php-mbstring

service httpd restart

for ubuntu/debian 检查当前安装的 php 版本并相应地安装模块。例如,如果安装了 php 7.2,请使用以下代码。

sudo apt install libapache2-mod-php7.2 php7.2-mcrypt php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-cli php7.2-zip php7.2-mysql

sudo systemctl restart apache2.service