在Ubuntu LTS 16.04上安装Magento 2时,出现了一些不同的错误

时间:2018-11-29 11:21:13

标签: amazon-ec2 apache2 ubuntu-16.04 magento2.2

我已经安装了这些软件包。

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

此命令后

composer install

我收到此错误

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 个答案:

答案 0 :(得分:1)

步骤1:首先,最好使用此命令从您的Ubuntu删除php。
 只会删除php及其模块

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

第2步: PHP 7.1在Ubuntu默认存储库上不可用…为了安装它,
 您将不得不从第三方存储库中获取它。
运行以下命令以添加以下第三方存储库以安装PHP 7.1

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

步骤:3 现在安装所需的模块。

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

答案 1 :(得分:1)

我遇到了同样的错误,使用此命令已解决错误      sudo apt-get install php-bcmath php-soap