composer报错:The requested PHP extension ext-bcmath * is missing from your system. Install or enable

解决compose报错:The requested PHP extension ext-bcmath * is missing from your system. Install or enable PHP's bcmath extension.

    • 报错
    • 解决方案:安装php的bcmath扩展
      • 1. 首先查看自己php版本
      • 2. 安装对应版本的扩展
      • 3. 安装完成后,重启下php
      • 4. 查看php扩展是否安装成功

报错

composer报错:The requested PHP extension ext-bcmath * is missing from your system. Install or enable_第1张图片

$ composer require --prefer-dist yiisoft/yii2-mongodb                            
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^2.1 for yiisoft/yii2-mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-bcmath * is missing from your system. Install or enable PHP's bcmath extension.
  Problem 2
    - The requested PHP extension ext-mcrypt * is missing from your system. Install or enable PHP's mcrypt extension.


Installation failed, reverting ./composer.json to its original content.

解决方案:安装php的bcmath扩展

1. 首先查看自己php版本

php -v

2. 安装对应版本的扩展

yum  -y install php72w-bcmath

注意:72w是代表7.2版本,安装的时候记得标明版本号

3. 安装完成后,重启下php

service php-fpm restart  或  systemctl restart php-fpm

4. 查看php扩展是否安装成功

php -m

composer报错:The requested PHP extension ext-bcmath * is missing from your system. Install or enable_第2张图片

你可能感兴趣的:(Php,Linux,Composer)