John Davidson

php - Symfony 5.4.9 Composer detected issues in your platform:

0 comments
Message:


I am totally new to Symfony. After I installed Symfony on my local ddev machine, I get this error


Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.29. in /var/www/html/symfony/vendor/composer/platform_check.php on line 24

I tried to composer install --ignore-platform-reqs as well, and soon as I run it, I get this error message


Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/html/symfony/vendor/psr/log/src/LoggerInterface.php on line 30

My php version is


❯ php -v
PHP 8.1.6 (cli) (built: May 12 2022 23:44:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies

Compose.json


    "type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "*",
"symfony/dotenv": "*",
"symfony/flex": "^1.17|^2",
"symfony/framework-bundle": "*",
"symfony/runtime": "*",
"symfony/yaml": "*"
},
"require-dev": {
},
"config": {

Thanks for help


Update


If you are using docker/ddev, make sure to set the php version inside `config.yml`

Make sure to php version matches the symfony requirements


name: ddev-gitpod
type: drupal9
docroot: web
php_version: "8.1"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
type: mariadb
version: "10.3"
nfs_mount_enabled: false
mutagen_enabled: false
use_dns_when_possible: true
composer_version: ""
web_environment: []
nodejs_version: "16"



My Answer:
that is not compatible with your current PHP version. Please make sure you are using a PHP version that meets the requirements of your Composer dependencies. You can check the PHP version required by your dependencies in the composer.json file or by running the command `composer show -i`.

Rate this post

4 of 5 based on 2663 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us