0

I'm trying to install Drupal 10 with DDEV with these instructions: https://ddev.readthedocs.io/en/latest/users/quickstart/#drupal. I'm on Ubuntu on Windows (WSL2). Ubuntu version: 20.04. Windows 10. When I try to run the command ddev composer require drush/drush I get errors.

Using version ^11.4 for drush/drush
./composer.json has been updated
Running composer update drush/drush
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.0.0 requires php >=8.1.0 -> your php version (8.0.14) does not satisfy that requirement.
    - drupal/core-recommended 10.0.0 requires drupal/core 10.0.0 -> satisfiable by drupal/core[10.0.0].
    - drupal/core-recommended is locked to version 10.0.0 and an update of this package was not requested.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require drush/drush:*" to figure out if any version is installable, or "composer require drush/drush:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer [require drush/drush] failed, composer command failed: exit status 2. stderr=

I upgraded PHP. php -v reports I installed PHP 8.2.0.

How can Composer say I am using PHP 8.0.14?

1

1 Answer 1

4

You’re executing PHP on your local machine, which has PHP 8.2 installed. You’re executing composer inside the VM, which has PHP 8.0 installed. You need to upgrade PHP inside your VM.

See Extending and Customizing Environments for instructions to do that in DDev.

1
  • 2
    This and you could even simply have Apache running a different PHP version than on the command line.
    – leymannx
    Dec 18, 2022 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.