我已经安装了PHP版本7.3.33,composer 1.1并运行多个laravel 7.x项目。
现在我正在尝试安装两个不同的Laravel项目。一个使用Laravel 9,另一个使用7. x。
如果我更新PHP和Composer版本,它会在现有的laravel 7. x项目中产生问题。
有没有办法升级/兼容老的laravel项目到composer 2和新的PHP版本。
Problem 1
- This package requires php ^8.0.2 but your PHP version (7.4.29) does not satisfy that requirement.
Problem 2
- Installation request for laravel/framework v9.1.0 -> satisfiable by laravel/framework[v9.1.0].
- laravel/framework v9.1.0 requires php ^8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 3
- Installation request for league/flysystem 3.0.8 -> satisfiable by league/flysystem[3.0.8].
- league/flysystem 3.0.8 requires php ^8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 4
- Installation request for psr/log 3.0.0 -> satisfiable by psr/log[3.0.0].
- psr/log 3.0.0 requires php >=8.0.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 5
- Installation request for psr/simple-cache 3.0.0 -> satisfiable by psr/simple-cache[3.0.0].
- psr/simple-cache 3.0.0 requires php >=8.0.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 6
- Installation request for symfony/console v6.0.3 -> satisfiable by symfony/console[v6.0.3].
- symfony/console v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 7
- Installation request for symfony/css-selector v6.0.3 -> satisfiable by symfony/css-selector[v6.0.3].
- symfony/css-selector v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 8
- Installation request for symfony/deprecation-contracts v3.0.0 -> satisfiable by symfony/deprecation-contracts[v3.0.0].
- symfony/deprecation-contracts v3.0.0 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 9
- Installation request for symfony/error-handler v6.0.3 -> satisfiable by symfony/error-handler[v6.0.3].
- symfony/error-handler v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 10
- Installation request for symfony/event-dispatcher v6.0.3 -> satisfiable by symfony/event-dispatcher[v6.0.3].
- symfony/event-dispatcher v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 11
- Installation request for symfony/event-dispatcher-contracts v3.0.0 -> satisfiable by symfony/event-dispatcher-contracts[v3.0.0].
- symfony/event-dispatcher-contracts v3.0.0 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 12
- Installation request for symfony/finder v6.0.3 -> satisfiable by symfony/finder[v6.0.3].
- symfony/finder v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 13
- Installation request for symfony/http-foundation v6.0.3 -> satisfiable by symfony/http-foundation[v6.0.3].
- symfony/http-foundation v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 14
- Installation request for symfony/http-kernel v6.0.4 -> satisfiable by symfony/http-kernel[v6.0.4].
- symfony/http-kernel v6.0.4 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 15
- Installation request for symfony/mailer v6.0.3 -> satisfiable by symfony/mailer[v6.0.3].
- symfony/mailer v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 16
- Installation request for symfony/mime v6.0.3 -> satisfiable by symfony/mime[v6.0.3].
- symfony/mime v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 17
- Installation request for symfony/process v6.0.3 -> satisfiable by symfony/process[v6.0.3].
- symfony/process v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 18
- Installation request for symfony/routing v6.0.3 -> satisfiable by symfony/routing[v6.0.3].
- symfony/routing v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 19
- Installation request for symfony/service-contracts v3.0.0 -> satisfiable by symfony/service-contracts[v3.0.0].
- symfony/service-contracts v3.0.0 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 20
- Installation request for symfony/string v6.0.3 -> satisfiable by symfony/string[v6.0.3].
- symfony/string v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 21
- Installation request for symfony/translation v6.0.3 -> satisfiable by symfony/translation[v6.0.3].
- symfony/translation v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 22
- Installation request for symfony/translation-contracts v3.0.0 -> satisfiable by symfony/translation-contracts[v3.0.0].
- symfony/translation-contracts v3.0.0 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 23
- Installation request for symfony/var-dumper v6.0.3 -> satisfiable by symfony/var-dumper[v6.0.3].
- symfony/var-dumper v6.0.3 requires php >=8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 24
- Installation request for nunomaduro/collision v6.1.0 -> satisfiable by nunomaduro/collision[v6.1.0].
- nunomaduro/collision v6.1.0 requires php ^8.0.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 25
- Installation request for spatie/flare-client-php 1.0.2 -> satisfiable by spatie/flare-client-php[1.0.2].
- spatie/flare-client-php 1.0.2 requires php ^8.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 26
- Installation request for spatie/ignition 1.0.5 -> satisfiable by spatie/ignition[1.0.5].
- spatie/ignition 1.0.5 requires php ^8.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 27
- Installation request for spatie/laravel-ignition 1.0.6 -> satisfiable by spatie/laravel-ignition[1.0.6].
- spatie/laravel-ignition 1.0.6 requires php ^8.0 -> your PHP version (7.4.29) does not satisfy that requirement.
Problem 28
- laravel/framework v9.1.0 requires php ^8.0.2 -> your PHP version (7.4.29) does not satisfy that requirement.
- laravel/sail v1.13.4 requires illuminate/console ^8.0|^9.0 -> satisfiable by laravel/framework[v9.1.0].
- Installation request for laravel/sail v1.13.4 -> satisfiable by laravel/sail[v1.13.4].
4条答案
按热度按时间ycl3bljg1#
我使用的是windows,我的解决方法是下载我想要的PHP版本,并将它们放在同一目录下的文件夹中。在
parent folder
中,我有php72
php74
php8
。然后我编辑我的路径位置在我的终端和指向同一文件夹,但我引用文件夹
php
。假设我的目录中有
php72
php74
php8
,并且我希望使用php8
,则将该文件夹重命名为php
现在我的目录看起来像
php72
php74
php
如果我需要更改为php72,我会将目录重命名为
php
php74
php8
我还为Composer实现了一个类似的解决方案
这是一个有点奇怪的黑客的方式,但它很容易实现,并为我工作,希望它可以为您太多。
mkshixfv2#
你需要为laravel 9创建一个新的环境,因为它与php 7不兼容。你可以用docker
Laravel sail
或虚拟机Laravel homestead
来做这件事。如果你使用的是
production environment
,我建议你使用其他的服务器示例或者部署在容器中,或者你也可以使用PHP-FPM和Apache / Nginx。如果您使用的是
Local environment
,并且不了解管理系统/ devops,则可以使用Laragon
或Wamp
并安装不同版本的PHPerhoui1w3#
这是因为在composer.json文件中的项目中,您有:
尝试将此要求更新为:
或者如果你不想安装新版本的PHP,你可以这样做。它会忽略请求。
ttygqcqt4#
我也遇到过同样的问题。我用这个解决了它:
composer 需要laravel/帆:*