gpt4 book ai didi

php - 即使安装了正确的 php 版本,为什么在 Composer 安装期间为过时的 php 版本出现版本不匹配?

转载 作者:行者123 更新时间:2023-12-01 13:26:30 25 4
gpt4 key购买 nike

鉴于非常基础 composer.json :

{
"name": "kopernikus/fizzbuzz",
"description": "FizzBuzz!",
"type": "project",
"require": {
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
},
"license": "MIT",
"authors": [
{
"name": "Philipp Kretzschmar",
"email": "philipp.kretzschmar@gmail.com"
}
]
}

如果我运行:
$ composer install

我得到:
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
- This package requires php ^7.0 but your PHP version (5.5) does not satisfy that requirement.
Problem 2
- phpunit/phpunit 5.7.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.26 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.25 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.24 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.23 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.18 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.17 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.15 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.14 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.12 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.11 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.10 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.7.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.6.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.5.7 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.5.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.5.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- phpunit/phpunit 5.5.4 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.5.3 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.5.2 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.5.1 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.5.0 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.8 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.7 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.6 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.5 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.4 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.3 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.2 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.1 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.4.0 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.5 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.4 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.3 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.2 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.1 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.3.0 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.9 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.8 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.7 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.6 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.5 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.4 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.3 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.2 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.12 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.11 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.10 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.1 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.2.0 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.7 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.6 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.5 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.4 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.3 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.2 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.1 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.1.0 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.9 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.8 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.7 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.6 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.5 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.4 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.3 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.2 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.10 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.1 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.0.0 requires php >=5.6 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- phpunit/phpunit 5.5.4 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.
- Installation request for phpunit/phpunit ^5 -> satisfiable by phpunit/phpunit[5.0.0, 5.0.1, 5.0.10, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.6.0, 5.6.1, 5.6.2, 5.6.3, 5.6.4, 5.6.5, 5.6.6, 5.6.7, 5.6.8, 5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.22, 5.7.23, 5.7.24, 5.7.25, 5.7.26, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].

To enable extensions, verify that they are enabled in your .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-apcu.ini
- /etc/php/7.0/cli/conf.d/20-apcu_bc.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-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-mongodb.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

我很困惑,因为:
php -v
PHP 7.0.26-2+ubuntu16.04.1+deb.sury.org+2 (cli) (built: Dec 7 2017 20:09:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.26-2+ubuntu16.04.1+deb.sury.org+2, Copyright (c) 1999-2017, by Zend Technologies

我还检查了 Composer 脚本,它定义了:
$ which composer
/usr/local/bin/composer

$ head -n 1 /usr/local/bin/composer
#!/usr/bin/env php

$ /usr/bin/env php
PHP 7.0.26-2+ubuntu16.04.1+deb.sury.org+2 (cli) (built: Dec 7 2017 20:09:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.26-2+ubuntu16.04.1+deb.sury.org+2, Copyright (c) 1999-2017, by Zend Technologies

diagnose没有理由 panic :
$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.6.1
PHP version: 7.0.26-2+ubuntu16.04.1+deb.sury.org+2
PHP binary path: /usr/bin/php7.0

为什么即使我只安装了 php@7, Composer 也认为我在运行 php@5.5?

最佳答案

检查你的 Composer 配置,你已经覆盖了你的 platform设置。

这在日志行中变得明显:

   - phpunit/phpunit 5.5.4 requires php ^5.6 || ^7.0 -> your PHP version (7.0.26-2+ubuntu16.04.1+deb.sury.org+2) overridden by "config.platform.php" version (5.5) does not satisfy that requirement.

重要的一点:
your PHP version (7...) overridden by "config.platform.php" version (5.5)

此外,您可以查看它是否通过以下方式设置:
$ composer config platform.php
5.5

它对构建机器很有用,以便 composer 可以在运行不同 php 版本的机器上安装依赖项。然而,它不应该一直存在于我的开发机器上。

我以前把平台设置成5.5还是可以的 composer install php7 下的 php5 项目,即使 composer install --ignore-platform-reqs就足够了,或者也可以在项目级别设置平台配置。我在全局配置中有它:
$ jq . ~/.composer/config.json 
{
"config": {
"platform": {
"php": "5.5"
}
}
}

在较新的 Composer 版本上,配置湾是以下内容的一部分:
jq . ~/.config/composer/composer.json 
{
"require": {
"hirak/prestissimo": "^0.3.7"
},
"config": {
"platform": {
"php": "5.5"
}
}
}

我也可能存在于您项目的 composer.json 中.

我不得不删除平台配置并且不得不 composer update项目的 composer.lock以及。仅删除配置是不够的。

关于php - 即使安装了正确的 php 版本,为什么在 Composer 安装期间为过时的 php 版本出现版本不匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48100614/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com