-
Notifications
You must be signed in to change notification settings - Fork 439
Description
What happened?
After upgrading to FrankenPHP v1.12.0, OPcache preloading no longer works. v1.11.2 works fine with the same configuration.
We observe two different failure modes depending on environment:
On ARM64 (AWS ECS, Debian): Every request returns a fatal error — a core PHP constant is undefined:
PHP Fatal error: Uncaught Error: Undefined constant "PHP_VERSION_ID" in /app/vendor/autoload.php:5
Stack trace:
#0 /app/public/index.php(22): require()
#1 {main}
On ARM64 (Docker Desktop for macOS): FrankenPHP hangs indefinitely during startup. The Caddy admin endpoint starts, TLS/HTTPS is configured, but the server never reaches the "FrankenPHP started" / "server running" state. No error is logged — it simply deadlocks.
Disabling opcache.preload resolves both issues immediately.
How to reproduce
- Use the
dunglas/frankenphp:1.12.0-php8.5Docker image - Enable OPcache preloading:
opcache.ini:
opcache.preload = /app/preload.php
opcache.preload_user = www-datapreload.php:
<?php
require_once __DIR__ . '/vendor/autoload.php';- Start FrankenPHP — it either hangs during startup or serves fatal errors on every request.
Environment
- FrankenPHP: v1.12.0
- PHP: 8.5.3 (ZTS)
- Caddy: v2.11.2
- Docker image:
dunglas/frankenphp:1.12.0-php8.5@sha256:7b54e661c5be17c5ace0efeec6b41f612509ea75028c0b72269f9ba8491431da - Caddyfile: Using
php_serverdirective (classic mode, not worker mode) - Tested on ARM64 (both Docker Desktop macOS and AWS ECS)
Working version
v1.11.2 with the same preload configuration works correctly:
dunglas/frankenphp:1-php8.5@sha256:7345f3393d108ba205c20240110f3688c20489b6a2caaf5bca3e99039f016aab
Additional context
- This may be related to the "sandboxed environment moved to C side" change in v1.12.0.
- Similar to Uncaught Error: Call to undefined function dirname() #685 where
dirname()became undefined due to OPcache preloading corruption.