craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

[3.x]: Your Composer dependencies require a PHP version ">= 8.0.2" #459

Closed alexwybraniec closed 2 years ago

alexwybraniec commented 2 years ago

What happened?

Description

Hello, I'm spinning up a new Craft 3 site using nitro create and targeting PHP 7.4, but I'm getting a Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2" error because it looks like some Symfony packages require ">=8.0.2".

I believe this is a Craft dependency issue (related to the use of Symfony components) rather than a Nitro specific issue (but please let me know if I'm wrong)

Steps to reproduce

  1. nitro create mysite.nitro
  2. Select 7.4 when asked Choose a PHP version
  3. Visit mysite.nitro in a browser

Expected behavior

Craft should work with PHP 7.4 as state Minimum System Specs is "PHP 7.2.5+" https://craftcms.com/docs/3.x/requirements.html#recommended-system-specs

Actual behavior

Craft returns Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /app/vendor/composer/platform_check.php on line 24

Craft CMS version

3.7.26

PHP version

7.4.28

Operating system and version

docker/nitro

Database type and version

mysql-8

Image driver and version

n/a

Installed plugins and versions

angrybrad commented 2 years ago

See here https://github.com/craftcms/nitro/issues/442#issuecomment-987152315 and the following comments for an explanation of this issue and a workaround.

alexwybraniec commented 2 years ago

Thank you @angrybrad