gpt4 book ai didi

php - Docker php无法构建:错误:版本^ 0.3的hirak/prestissimo软件包对PHP的要求与您的PHP版本不兼容

转载 作者:行者123 更新时间:2023-12-02 19:44:05 25 4
gpt4 key购买 nike

我一直在尝试建立一个api平台项目大约两天。 PHP服务将无法建立。我已经尝试了许多版本的php和composer,但没有一个起作用。我已经将docker,composer,php更新到最新版本,但仍然得到相同的结果。
错误:

    + composer global require hirak/prestissimo:^0.3 --prefer-dist --no-progress --no-suggest --classmap-authoritative
Changed current directory to /root/.composer
You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.


[RuntimeException]
No composer.json present in the current directory, this may be the cause of the following exception.



[InvalidArgumentException]
Package hirak/prestissimo at version ^0.3 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version


require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...

ERROR: Service 'php' failed to build: The command '/bin/sh -c set -eux; composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative; composer clear-cache' returned a non-zero code: 1
目前,我正在使用 Composer 2,PHP 7.4

最佳答案

这是问题的解释。
https://github.com/coopcycle/coopcycle-web/issues/1853

Yes, Composer 2.0 has parallel downloads, so it's not needed anymore


所以我认为,当您使用 Composer 2时,应该删除插件以解决问题。

关于php - Docker php无法构建:错误:版本^ 0.3的hirak/prestissimo软件包对PHP的要求与您的PHP版本不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64713197/

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