Laravel版本,PHP版本和作曲家版本兼容性问题
我已经安装了PHP版本7.3.33,作曲家1.1并运行了多个Laravel 7.X项目。
现在,我正在尝试安装两个不同的Laravel项目。一个带有Laravel 9,另一个为7.x。
如果我更新PHP和作曲家版本,它将在现有的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].
I have installed PHP version 7.3.33, composer 1.1 and running multiple laravel 7.x projects.
Now I am trying to install two different Laravel Projects. One with Laravel 9 and the other with 7.x.
If I update the PHP and Composer Version, it will create issues in existing laravel 7.x projects.
Is there any way to Upgrade/ make compatible the old laravel projects to composer 2 and new PHP version.
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].
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我在Windows上,以及如何通过下载我想要的PHP版本并将其放入同一目录内的文件夹中。
内部
parent文件夹
我有php72
php74
php8
。然后,我在终端中编辑路径位置,并指向相同的文件夹,但是我引用文件夹
php
。假设在我的目录中,我有
php72
php74
php8
,我希望使用php8
我会将该文件夹重命名为php
现在我的目录看起来像
php72
php74
php
如果我需要更改为php72,我将重命名目录如下
php
php74
php8
我还为作曲家实现了类似的解决方案,
这是一些怪异的骇人听闻的方式,但是它易于实现,对我有效,希望它也可以。
I'm on windows and how I combat this is by downloading the versions of PHP I desire and putting them inside folders that are within the same directory.
Inside
parent folder
I havephp72
php74
php8
.Then I edit my path location in my terminal and point to that same folder however I reference the folder
php
.Assuming in my directory I have
php72
php74
php8
and I wish to usephp8
I would rename that folder to justphp
Now my directory looks like this
php72
php74
php
If I need to change to php72 I would rename the directories as below
php
php74
php8
I also implement a similar solution for composer
It's a bit of weird hacky way, however its easy to implement and works for me, hopefully it can for you too.
您需要为Laravel 9创建一个新的环境,因为它与PHP 7不兼容。您可以与Docker
Laravel Sail
或Virtual MachineLaravel Homestead
。如果您在
生产环境
上,我建议您使用另一个服务器实例或在容器中部署。换句话说,您还可以将php-fpm与apache / nginx一起使用。
如果您在
本地环境
中,并且对管理系统/DEVOPS不了解,则可以使用laragon
或wamp
并安装不同的PHP的版本You need to create a new environment for the laravel 9 since it's not compatible with php 7. You can do it with docker
Laravel sail
or Virtual MachineLaravel homestead
.If you'r on a
production environment
, i recommend you to use another server instance or deploy in a container.In other way, you also can use PHP-FPM with Apache / Nginx.
If you're on
Local environment
and don't have any knowledge of admin system / devops, you can useLaragon
orWamp
and install different version of PHP这是因为在您的composer.json文件中,您有:
尝试将此要求更新为:
或其他选项,如果您不安装任何新版本PHP,则可以执行此操作。它将忽略reqs。
It's because in your project in composer.json file you have:
Try to update this requirement to:
Or another option if you wouldn't to install any new version PHP you can do this. It will ignore reqs.
我也有同样的问题。我用这个解决了:
I also had the same problem. I solved it with this:
这需要更改您的PHP版本使用下一个:
类型选择编号:5
选择版本php8.0
This needs to change your PHP version use the next:
Type selection number: 5
to chose the version php8.0