A PHP security patch inside a container normally arrives through a rebuilt image. Downloading that image and putting it into service are separate steps. Your update plan also needs to protect the database and persistent files that outlive the container.
Back up application data, its database where applicable, and configuration before changing the image. Pull a supported patched release, recreate the service, verify the replacement container, and check the critical user action before recording the update as complete.
1. Record the current deployment
Confirm the project directory and service names with docker compose ps. Record current image tags and image IDs with docker compose images, plus where persistent volumes and database state live. Store a protected copy of the Compose configuration without exposing secrets in shared logs.
Check the destination image's release notes for the PHP fix. A tag named latest is not evidence of a particular patch. If you use a digest pin, it must change to the verified replacement digest.
2. Take a consistent backup
Use the application's documented backup method. Preserve configuration, files, and a database backup from a consistent recovery point. Coordinate write suspension or maintenance mode when the application requires it. A filesystem copy of a live database directory is not a universal substitute for a valid database backup.
Keep the recovery copy outside the application's writable reach and know how to restore it. Preserve the prior configuration and image reference, but remember that restoring an old vulnerable image should not put it straight back on the public internet.
3. Pull and recreate the intended service
For a maintainer-published image, update the service's image reference to a compatible fixed release, then use this example from the correct project directory. Replace app with your PHP application service:
docker compose pull app
docker compose up -d --no-deps app
docker compose ps
docker compose exec -T app php -vDocker documents that pull downloads images without starting containers; up applies image or configuration changes by recreating containers. Here, --no-deps limits the change to the selected service. Use it only when dependent services are already healthy and compatible.
For custom builds, update the relevant PHP base or packages, rebuild through your normal build pipeline, and deploy the resulting image. Repeat for workers using that runtime. Do not patch an ephemeral container shell and assume the fix will survive recreation.
4. Validate the application before reopening access
Check logs locally for startup errors without sharing tokens or private paths. Confirm the web runtime, then test login, file browsing, a small upload, and a background task. Verify that volume paths and ownership still match the intended layout.
If public access was restricted, restore it only after the version and functional checks pass. A green container status alone does not establish that uploads or background jobs work.
5. Recover deliberately if validation fails
Keep the service isolated while investigating. Restore application files and database state together when the app's migration rules require it; changing only the image can be unsafe after a schema upgrade. Do not use docker compose down -v as a troubleshooting shortcut because it can remove named volumes.
For ZimaCube 2 users, separate the update record from your bulk files and keep independent backups. A successful update ends with a known runtime, working application functions, and a recovery path you can still explain.
Explore ZimaCube 2 Personal Cloud Home NAS for your private storage and self-hosted application setup. Software security depends on the installed services, their configuration, and verified updates.
Continue the PHP security series
Sources and scope
Checked October 22, 2026. Deployment advice must be matched to your application and vendor documentation; these articles do not establish product-specific exposure.
Support & Tips
More to Read

How to Check Memory and Runtime Requirements Before Running LFM2.5-24B-A2B
Check LFM2.5-24B-A2B weight format, memory overhead, runtime versions, context, and tool compatibility before attempting a home-server deployment.

How to Test Granite Speech 5.0 with English Audio Files Stored on Your NAS
Test Granite Speech 5.0 on a short English recording from your NAS. Verify checkpoint revision, runtime, sample rate, transcript quality, and output handling.

How to Prepare Files and Permissions for a Claude Duet Workflow
Prepare a Claude Duet task with selected files, scoped connected accounts, separate drafts, reviewable outputs, and a clear connection-removal plan.

