Ddev legacy php
Cross-project agent workflow skills — session onboarding, handoffs, PR review, and merge workflows
npx -y skills add jsirish/workflow-skills --skill ddev-legacy-phpAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Enable EOL PHP versions (5.6–7.4) in DDEV v1.24+ on Apple Silicon (ARM64)
SKILL.md
2.5 KB, 683 tokens by cl100k_base, as published. Nobody here has run it
DDEV Legacy PHP Setup
Problem
DDEV v1.24+ removed end-of-life PHP versions (5.6, 7.0, 7.1, 7.2, 7.3, 7.4) from the default web container images. On Apple Silicon (ARM64) Macs, these versions also lack native ARM64 packages in the Ondřej Surý PPA, so even the built-in install_php_extensions.sh script will fail with Unable to locate package errors.
Solution
Two files are needed in the project's .ddev/ directory:
1. Force amd64 emulation
Create .ddev/docker-compose.amd64.yaml:
services:
web:
platform: linux/amd64
This forces the web container to run under Rosetta/QEMU x86_64 emulation, giving access to the full x86 PHP package ecosystem.
2. Install the legacy PHP version
Create .ddev/web-build/Dockerfile (or append to it if one already exists):
RUN /usr/local/bin/install_php_extensions.sh "php7.4" "${TARGETARCH}"
Replace php7.4 with whichever legacy version is needed (e.g. php7.2, php5.6).
3. Restart DDEV
ddev restart
The first build will take several minutes as it pulls amd64 images. Verify with:
ddev exec php -v
Steps to Apply
- Check the project's
.ddev/config.yamlforphp_version— confirm it specifies the legacy version. - Create
.ddev/docker-compose.amd64.yamlwith the platform override shown above. - Create or append to
.ddev/web-build/Dockerfilewith theinstall_php_extensions.shline, substituting the correct PHP version. - Run
ddev restartand wait for the container build to complete. - Verify with
ddev exec php -v.
Tradeoffs
- Performance: Expect ~20–50% slower execution due to x86 emulation via Rosetta. Native ARM64 services (database, router) are unaffected.
- Long-term: This is a stopgap. Upgrading the codebase to PHP 8.1+ is the recommended path — at that point, delete both files to return to native ARM64 performance.
When to Remove
When the project upgrades to a supported PHP version (8.1+):
- Delete
.ddev/docker-compose.amd64.yaml - Delete
.ddev/web-build/Dockerfile(or remove theinstall_php_extensions.shline) - Update
php_versionin.ddev/config.yaml - Run
ddev restart