skip to Main Content

I have already installed these packages.

sudo apt-get install apache2 php libapache2-mod-php mysql-server php-mysql php-dom 
php-simplexml php-curl php-intl php-xsl php-mbstring php-zip php-xml composer

After this command

composer install

I am getting this error

Problem 1
    - This package requires php ~7.1.3||~7.2.0 but your PHP version (7.0.32) does not satisfy that requirement.
  Problem 2
    - The requested PHP extension ext-bcmath * is missing from your system. Install or enable PHP's bcmath extension.
  Problem 3
    - The requested PHP extension ext-soap * is missing from your system. Install or enable PHP's soap extension.
  Problem 4
    - Installation request for magento/composer 1.4.0 -> satisfiable by magento/composer[1.4.0].
    - magento/composer 1.4.0 requires php ~7.1.3|~7.2.0 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 5
    - Installation request for php-amqplib/php-amqplib v2.7.3 -> satisfiable by php-amqplib/php-amqplib[v2.7.3].
    - php-amqplib/php-amqplib v2.7.3 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
  Problem 6
    - Installation request for symfony/console v4.1.6 -> satisfiable by symfony/console[v4.1.6].
    - symfony/console v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 7
    - Installation request for symfony/event-dispatcher v4.1.6 -> satisfiable by symfony/event-dispatcher[v4.1.6].
    - symfony/event-dispatcher v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 8
    - Installation request for symfony/filesystem v4.1.6 -> satisfiable by symfony/filesystem[v4.1.6].
    - symfony/filesystem v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 9
    - Installation request for symfony/finder v4.1.6 -> satisfiable by symfony/finder[v4.1.6].
    - symfony/finder v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 10
    - Installation request for symfony/process v4.1.6 -> satisfiable by symfony/process[v4.1.6].
    - symfony/process v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 11
    - Installation request for zendframework/zend-code 3.3.1 -> satisfiable by zendframework/zend-code[3.3.1].
    - zendframework/zend-code 3.3.1 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 12
    - Installation request for zendframework/zend-soap 2.7.0 -> satisfiable by zendframework/zend-soap[2.7.0].
    - zendframework/zend-soap 2.7.0 requires ext-soap * -> the requested PHP extension soap is missing from your system.
  Problem 13
    - Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
    - doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 14
    - Installation request for doctrine/collections v1.5.0 -> satisfiable by doctrine/collections[v1.5.0].
    - doctrine/collections v1.5.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 15
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 16
    - Installation request for moontoast/math 1.1.2 -> satisfiable by moontoast/math[1.1.2].
    - moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
  Problem 17
    - Installation request for myclabs/deep-copy 1.8.1 -> satisfiable by myclabs/deep-copy[1.8.1].
    - myclabs/deep-copy 1.8.1 requires php ^7.1 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 18
    - Installation request for symfony/browser-kit v4.1.6 -> satisfiable by symfony/browser-kit[v4.1.6].
    - symfony/browser-kit v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 19
    - Installation request for symfony/config v4.1.6 -> satisfiable by symfony/config[v4.1.6].
    - symfony/config v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 20
    - Installation request for symfony/css-selector v4.1.6 -> satisfiable by symfony/css-selector[v4.1.6].
    - symfony/css-selector v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 21
    - Installation request for symfony/dependency-injection v4.1.6 -> satisfiable by symfony/dependency-injection[v4.1.6].
    - symfony/dependency-injection v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 22
    - Installation request for symfony/dom-crawler v4.1.6 -> satisfiable by symfony/dom-crawler[v4.1.6].
    - symfony/dom-crawler v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 23
    - Installation request for symfony/http-foundation v4.1.6 -> satisfiable by symfony/http-foundation[v4.1.6].
    - symfony/http-foundation v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 24
    - Installation request for symfony/options-resolver v4.1.6 -> satisfiable by symfony/options-resolver[v4.1.6].
    - symfony/options-resolver v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 25
    - Installation request for symfony/stopwatch v4.1.6 -> satisfiable by symfony/stopwatch[v4.1.6].
    - symfony/stopwatch v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
  Problem 26
    - symfony/console v4.1.6 requires php ^7.1.3 -> your PHP version (7.0.32) does not satisfy that requirement.
    - sebastian/phpcpd 3.0.1 requires symfony/console ^2.7|^3.0|^4.0 -> satisfiable by symfony/console[v4.1.6].
    - Installation request for sebastian/phpcpd 3.0.1 -> satisfiable by sebastian/phpcpd[3.0.1].

To enable extensions, verify that they are enabled in those .ini files:

- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/15-xml.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-curl.ini
- /etc/php/7.0/cli/conf.d/20-dom.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gd.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-intl.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-mbstring.ini
- /etc/php/7.0/cli/conf.d/20-mcrypt.ini
- /etc/php/7.0/cli/conf.d/20-mysqli.ini
- /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-simplexml.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
- /etc/php/7.0/cli/conf.d/20-wddx.ini
- /etc/php/7.0/cli/conf.d/20-xmlreader.ini
- /etc/php/7.0/cli/conf.d/20-xmlwriter.ini
- /etc/php/7.0/cli/conf.d/20-xsl.ini
- /etc/php/7.0/cli/conf.d/20-zip.ini

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

2

Answers


  1. step1: first better to remove the php from your ubuntu using this command.
    it will only remove php and its modules

    sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "n" " "`
    

    step2: PHP 7.1 isn’t available on Ubuntu default repositories… in order to install it,
    you will have to get it from third-party repositories.
    Run the commands below to add the below third party repository to install PHP 7.1

    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    

    step:3
    now install the required modules.

    sudo apt-get install php7.1 libapache2-mod-php7.1 php7.1-common php7.1-mbstring   php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-zip php7.1-curl composer
    
    Login or Signup to reply.
  2. I got the same error, using this command error is resolved
    sudo apt-get install php-bcmath php-soap

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search