Score:0

Problem with PHP version on Ubuntu on Windows when installing Drush

ke flag

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?

leymannx avatar
ne flag
`ddev config --php-version 8.1 && ddev restart`, see https://ddev.readthedocs.io/en/latest/users/configuration/config/
Score:4
cn flag

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.

leymannx avatar
ne flag
This and you could even simply have Apache running a different PHP version than on the command line.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.