简体   繁体   中英

Failed to run composer to install laravel 7

Hello I found a problem here in which I am unable to run the composer, and I am receiving the following error:

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.

Does anyone know how to tell me where I'm going wrong? And how can I be solving this problem?

Laravel 7 requires the following php modules

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

use the following code to install them on fedora/centos/rhel. This will install missing modules only,

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

service httpd restart

for ubuntu/debian check the current php version installed and install modules accordingly. for example, if php 7.2 is installed, use the following code.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM