← ClaudeAtlas

php-docker-upgradelisted

Bump the PHP version of a Dockerized, Makefile-driven project (e.g. a Drupal site) to a target version — 8.4, 8.5 or later. Use when the user mentions upgrading PHP in Docker, changing the PHP base image / Dockerfile version, a "platform.php" constraint, or needs a newer PHP for a framework upgrade (e.g. PHP 8.4 required by Drupal 11). Covers locating the image, bumping it, rebuilding containers, verifying, and updating the Composer platform pin. IMPORTANT: all build commands MUST go through Makefile targets, never run directly on the host.
JMAILLY/claude-migration-skills · ★ 0 · DevOps & Infrastructure · score 70
Install: claude install-skill JMAILLY/claude-migration-skills
# PHP version upgrade in a Docker environment Bump the PHP runtime of the containers to a **target version** BEFORE touching the framework/core — otherwise `composer update` fails or the site won't boot. **Target version is a parameter.** Set `<PHP_VERSION>` to what you need: - Drupal 11 → **8.4** (current requirement) - Future majors (e.g. Drupal 12) → **8.5+** — the procedure is identical, only the number changes. If the caller (e.g. the `d11` orchestrator) already fixed the target, use it. Otherwise ask the user which PHP version to target. ## Golden rule: everything goes through the Makefile This project is **Dockerized and driven by a Makefile**. Never call `composer`, `php` or `docker` directly on the host — use the `make` targets: | Need | Make target | |---|---| | Rebuild images (with cache) | `make rebuild` | | Rebuild without cache | `make rebuild-no-cache` | | Shell in the PHP container | `make shell` | | Composer install + npm install | `make install` | | Generic Composer | `make composer <args>` | | Drush status | `make drush c='status'` | ## 1. Locate the Dockerfile / PHP image The image is defined either in a dedicated `Dockerfile` or in `docker-compose.yml`. ```bash grep -rn 'php:' docker/ 2>/dev/null grep -rn 'FROM php' docker/ 2>/dev/null find . -name 'Dockerfile*' -not -path './vendor/*' -not -path './node_modules/*' ``` ## 2. Update the PHP version In the PHP service Dockerfile, replace the base image version: ```dockerfile # BEFORE FROM php