Laravel PHP版本

发布于 2025-02-03 08:45:04 字数 393 浏览 2 评论 0原文

当我检查PHP版本时,它显示了8.0.3,但我将版本更改为Laragon中的7.2.0。 当我在Laravel中运行Composer Update命令时,会生成错误

问题1

  • root Composer.json需要PHP ^7.2.0,但是您的PHP版本(8.0.3)不满足该要求。

问题2

  • laravel/框架[v5.8.0,...,5.8.x -dev]要求php ^7.1.3 - >您的PHP版本(8.0.3)无法满足该要求。
  • root Composer.json需要Laravel/Framework 5.8。* - >可以通过Laravel/Framework [V5.8.0,...,5.8.x-dev]满足。

when I check my PHP version it shows 8.0.3 but I changed the version to 7.2.0 in Laragon.
when I run the composer update command in Laravel it generates the error

Problem 1

  • Root composer.json requires PHP ^7.2.0 but your PHP version (8.0.3) does not satisfy that requirement.

Problem 2

  • laravel/framework[v5.8.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.0.3) does not satisfy that requirement.
  • Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

土豪 2025-02-10 08:45:04

这是PHP中常见的问题,因为您的PHP版本与Laravel或您使用的软件包不匹配。现在,最好转到Composer.json文件,该文件说您可以使用这种方式的最后一个版本。

"require": {
    "php": "^ 8.0.2",

例如,在Laravel版本9中,最低PHP版本为8.0.2

This is a common problem in PHP because your PHP version does not match Laravel or the packages you use. Now it's better to go to the composer.json file that says the last version you can have this way.

"require": {
    "php": "^ 8.0.2",

For example, in Laravel version 9, the minimum PHP version is 8.0.2

深居我梦 2025-02-10 08:45:04

在您的命令行类型中:

composer require

按ENTER,然后将要求包装键

search for a package : php

按Enter,然后要求使用版本

Enter the version constraint to require (or leave blank to use the latest version) : 7.1.3

Enter两次。希望这会有所帮助。

In your command line type:

composer require

press enter and then it will ask for the package

search for a package : php

press enter and then it will ask for the version

Enter the version constraint to require (or leave blank to use the latest version) : 7.1.3

press enter twice. Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文