PHP version issue when trying to update core

Created on 22 November 2023, 7 months ago

When trying to update Drupal 10.1.5 to 10.1.6 I get this message from Composer:

when I run: composer update "drupal/core-*" --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/core 10.1.5 requires php >=8.1.0 -> your php version (8.0.30) does not satisfy that requirement.
- drupal/core-recommended 10.1.5 requires drupal/core 10.1.5 -> satisfiable by drupal/core[10.1.5].
- Root composer.json requires drupal/core-recommended 10.1.5 -> satisfiable by drupal/core-recommended[10.1.5].

The server is set to php 8.1.25 and drupal status indicates it as 8.1.25 yet composer is saying it's 8.0.30

Where or how should I correct this?

πŸ’¬ Support request
Status

Active

Version

10.1 ✨

Component
ComposerΒ  β†’

Last updated about 20 hours ago

No maintainer
Created by

πŸ‡ΏπŸ‡¦South Africa nravens

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nravens
  • πŸ‡ΏπŸ‡¦South Africa nravens
  • πŸ‡ΏπŸ‡¦South Africa nravens

    I seem to have resolved this by following these steps:
    In composer.json I added this
    "platform":{
    "php":"8.1.25"
    }
    below - "sort-packages": true,

    That solved the PHP version requirement but running composer "drupal/core-*" --with-all-dependencies said there was nothing to install

    Then I ran:
    composer require drupal/core-recommended:10.1.6 drupal/core-composer-scaffold:10.1.6 drupal/core-project-message:10.1.6 --update-with-all-dependencies

    This updated the site to 10.1.6

  • πŸ‡¬πŸ‡§United Kingdom longwave UK
    - drupal/core 10.1.5 requires php >=8.1.0 -> your php version (8.0.30) does not satisfy that requirement.
    

    This means that when you were running Composer you were using PHP 8.0.30. It is possible to have different versions of PHP on the command line and in the web server. What is the output of php -v?

Production build 0.69.0 2024