php-docker-upgradelisted
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