Skip to content

fix: handle PHP extended support versions in mw ddev init#1696

Merged
martin-helmich merged 4 commits into
masterfrom
copilot/fix-ddev-init-php-support
Mar 11, 2026
Merged

fix: handle PHP extended support versions in mw ddev init#1696
martin-helmich merged 4 commits into
masterfrom
copilot/fix-ddev-init-php-support

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

PHP extended support versions (e.g. 7.2-es) were passed verbatim to ddev config --php-version, which DDEV rejects. The fix strips the -es suffix before writing the DDEV config and surfaces a warning to the user.

Changes

  • config_builder.ts

    • stripPatchLevelVersion now strips the -es suffix (e.g. 7.2-es7.2)
    • Added hasExtendedSupportSuffix / extendedSupportSuffixPattern (exported for testability)
    • determinePHPVersion refactored to return { version, warnings } instead of mutating a caller-supplied array
    • build() return type changed to DDEVConfigBuildResult { config, warnings }
  • init.tsx / render-config.ts: consume the new return shape; emit normalization warnings via r.addInfo() / this.warn()

  • config_builder.test.ts (new): unit tests for hasExtendedSupportSuffix and stripPatchLevelVersion

Warning emitted

Warning: The PHP version used by this project (7.2-es) is an extended support version
that is not directly supported by DDEV. Falling back to PHP 7.2.
This may cause unintended side effects.
Original prompt

This section details on the original issue you should resolve

<issue_title>mw ddev init fails for projects using PHP extended support</issue_title>
<issue_description>Describe the bug
mw ddev init fails when the mStudio project uses an "extended support" PHP version. These use version strings like 7.2-es, which are then incorrectly passed into ddev config

Expected behavior
DDEV projects using PHP versions in extended support should fall back to the "regular" closed-matching version supported by DDEV.

A warning message should be printed, alerting the user to the difference in versions and potential unintended side effects.

Console logs

installing mittwald plugin. error Unable to get project : the swc-d10.2 project has an unsupported PHP version: 7.2-es, DDEV only supports the following versions: [5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5]
 An error occurred during this operation:
 Error: ddev exited with code 1

┌──────────────────────────────────────────────────────────────────────────────┐
│ ERROR                                                                        │
│                                                                              │
│ An error occurred while executing this command:                              │
│                                                                              │
│ Error: ddev exited with code 1                                               │
│                                                                              │
│ If you believe this to be a bug, please open an issue at                     │
│ https://github.com/mittwald/cli/issues/new.                                  │
└──────────────────────────────────────────────────────────────────────────────┘

ERROR STACK TRACE
Please provide this when opening a bug report.
Error: ddev exited with code 1 at ChildProcess.<anonymous> (file:///opt/homebrew/Cellar/mw/1.13.3/libexec/dist/rendering/process/process_exec.js:26:24) at ChildProcess.emit (node:events:524:28) at ChildProcess._handle.onexit (node:internal/child_process:293:12)

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Fixes mw ddev init failing when the mStudio project uses a PHP extended
support version (e.g. 7.2-es). The fix normalizes such versions by
stripping the -es suffix before passing them to DDEV config, and emits
a warning alerting the user to the version difference.

Closes #<issue>"

Co-authored-by: martin-helmich <2538958+martin-helmich@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix mw ddev init failure for extended support PHP versions fix: handle PHP extended support versions in mw ddev init Mar 11, 2026
Comment thread src/lib/ddev/config_builder.ts Outdated
Comment thread src/lib/ddev/config_builder.ts Outdated
…rsion to return warnings

Co-authored-by: martin-helmich <2538958+martin-helmich@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@martin-helmich martin-helmich marked this pull request as ready for review March 11, 2026 10:50
@martin-helmich martin-helmich merged commit 0325053 into master Mar 11, 2026
13 checks passed
@martin-helmich martin-helmich deleted the copilot/fix-ddev-init-php-support branch March 11, 2026 14:35
mittwald-machine added a commit that referenced this pull request Mar 12, 2026
## [1.13.4](v1.13.3...v1.13.4) (2026-03-12)

### Bug Fixes

* **ddev:** handle PHP extended support versions in `mw ddev init` ([#1696](#1696)) ([0325053](0325053)), closes [#1695](#1695)
* **ssh:** embed known host keys for mittwald clusters ([#1667](#1667)) ([1ab2917](1ab2917)), closes [#1260](#1260)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mw ddev init fails for projects using PHP extended support

2 participants