Skip to content

docs: update legacy PHP/MySQL guide for current DDEV, fixes #737 - #746

Merged
stasadev merged 4 commits into
ddev:mainfrom
stasadev:20260904_CyberSymbol_legacy_mysql55_restart_safe
Sep 24, 2026
Merged

stasadev merged 4 commits into
ddev:mainfrom
stasadev:20260904_CyberSymbol_legacy_mysql55_restart_safe

Conversation

@stasadev

Copy link
Copy Markdown
Member

The Issue

The legacy MySQL 5.5 guide pinned ddev/ddev-dbserver-mysql-5.5:v1.24.6. With a custom .ddev/mysql/*.cnf file, restarting the DB container could fail with cp: cannot create regular file '/etc/mysql/conf.d/legacy.cnf': Permission denied. DDEV v1.24.7 fixed that. The rest of the recipe was also stuck on that one image, because the entrypoint was patched by line number.

How This PR Solves The Issue

A pre-start hook takes the legacy image name from $DDEV_DBIMAGE, so it always matches the installed DDEV version. That fixes the restart failure and keeps working after DDEV upgrades. The entrypoint patches now match on patterns, not line numbers. A custom image name stops the build from overwriting DDEV's own ddev-dbserver-mysql-8.0 image.

The article is also updated for current DDEV: x-ddev keys label the services in ddev describe, ddev ssh -s php -u devilbox replaces a raw docker exec, and Step 2 is marked as needed only on ARM64, since AMD64 supports MySQL 5.5 directly.

Manual Testing Instructions

https://pr-746.ddev-com-fork-previews.pages.dev/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev/

Build the project from Steps 1 to 4 on Apple Silicon. ddev mysql should report 5.5.62-log, ddev restart should not complain about a version mismatch, and ddev ssh -s php -u devilbox should open a PHP 5.3 shell.

Automated Testing Overview

No tests needed, documentation-only change.

Release/Deployment Notes

No deployment changes are required.

🤖 Developed with assistance from Claude Code

CyberSymbol and others added 2 commits September 24, 2026 16:25
## The Issue

- Fixes ddev#737

The legacy MySQL 5.5 guide pinned `ddev/ddev-dbserver-mysql-5.5:v1.24.6`, which can fail on restart with `Permission denied` when a custom `.ddev/mysql/*.cnf` is present. The pin also left the rest of the recipe stale: the entrypoint was patched by line number, so it only worked with that one image.

## How This PR Solves The Issue

A `pre-start` hook derives the legacy image from `$DDEV_DBIMAGE`, so it always matches the installed DDEV version. That fixes the restart failure (DDEV v1.24.7+) and keeps working after upgrades. The entrypoint patches now match on patterns instead of line numbers.

The rest updates the article for current DDEV: `x-ddev` keys label the services in `ddev describe`, `ddev ssh -s php -u devilbox` replaces a raw `docker exec`, and Step 2 is marked ARM64-only since AMD64 supports MySQL 5.5 directly.

## Manual Testing Instructions

https://pr-738.ddev-com-fork-previews.pages.dev/blog/legacy-projects-with-unsupported-php-and-mysql-using-ddev/

Build the project from Steps 1 to 4 on Apple Silicon. `ddev mysql` should report `5.5.62-log`, `ddev restart` should not complain about a version mismatch, and `ddev ssh -s php -u devilbox` should land in a PHP 5.3 shell.

## Automated Testing Overview

No tests needed, documentation-only change.

## Release/Deployment Notes

No deployment changes are required.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🌐 Fork Preview for PR #746

https://pr-746.ddev-com-fork-previews.pages.dev

This preview updates automatically when you push changes to your fork.

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

args:
BASE_IMAGE: ddev/ddev-dbserver-mysql-5.5:v1.24.6
BASE_IMAGE: ${DDEV_DB_LEGACY_IMAGE}
#image: ${DDEV_DB_LEGACY_IMAGE}-${DDEV_SITENAME}-built

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is being commented on because the fix has not been released yet:

@stasadev
stasadev merged commit 2992641 into ddev:main Sep 24, 2026
4 checks passed
@stasadev
stasadev deleted the 20260904_CyberSymbol_legacy_mysql55_restart_safe branch September 24, 2026 15:10
@github-actions

Copy link
Copy Markdown

PR closed. The Cloudflare Pages preview is no longer updated.

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.

Legacy MySQL 5.5 guide can fail on repeated DB container starts with custom .cnf

3 participants