Skip to content

OPcache preloading broken in v1.12.0 — hangs on startup / undefined constant errors #2255

@jdempster

Description

@jdempster

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

  1. Use the dunglas/frankenphp:1.12.0-php8.5 Docker image
  2. Enable OPcache preloading:

opcache.ini:

opcache.preload = /app/preload.php
opcache.preload_user = www-data

preload.php:

<?php
require_once __DIR__ . '/vendor/autoload.php';
  1. 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_server directive (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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions