Clarify setup requirements around PHP version

Created on 20 March 2023, over 1 year ago
Updated 21 March 2023, over 1 year ago

Documentation location/URL

https://www.drupal.org/docs/official_docs/en/_local_development_guide.html β†’

Problem/Motivation

Someone new to Drupal flagged with me that following the steps here results in a bit of a roadblock.

If you run:
ddev composer create "drupal/recommended-project"

You get Drupal 10 (10.0.5 currently). Then if you try to run:
ddev composer require drush/drush

You get an error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/core 10.0.5 requires php >=8.1.0 -> your php version (8.0.28) does not satisfy that requirement.
    - drupal/core-recommended 10.0.5 requires drupal/core 10.0.5 -> satisfiable by drupal/core[10.0.5].
    - drupal/core-recommended is locked to version 10.0.5 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.

This is because ddev is using php 8.0.28 by default. If you know what's going on, then it's easy to resolve. But if you are new you would have no idea what's going on.

Proposed resolution

Not sure what the ideal resolution is, but one option would be to have separate steps for installing D9 and D10, with some explanation about the php version required for D10?

Remaining tasks

  1. Agree on resolution
  2. Update docs
πŸ“Œ Task
Status

Fixed

Version

9.0

Component

Content

Created by

πŸ‡¦πŸ‡ΊAustralia pameeela

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

Comments & Activities

  • Issue created by @pameeela
  • πŸ‡ΊπŸ‡ΈUnited States eojthebrave Minneapolis, MN

    I think we should change this command

    ddev config --docroot web --project-name $SITE_NAME --project-type drupal9 --create-docroot

    to

    ddev config --docroot web --project-name $SITE_NAME --project-type drupal10 --create-docroot

    So that it configures DDEV for Drupal 10 instead of Drupal 9. Which, looks like it would also use PHP8.1. Though I haven't actually tried it personally.

  • @eojthebrave opened merge request.
  • πŸ‡¦πŸ‡ΊAustralia pameeela

    I have confirmed this works, so that's a good, simple solution. Tested the full guide and it works through to a functioning local site :)

    Thanks!

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States eojthebrave Minneapolis, MN

    Great! Thanks for reporting this, and then helping test things. I'll merge the changes in and work on getting it updated on d.o. ASAP.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024