I'm using https://github.com/dunglas/symfony-docker to setup a new Symfony project. When I provide a wrong filename to opcache.preload option, the PHP interpreter does not found builtin function like dirname(). This problem happens only on production environment.
I've tried to reproduce with minimum complexity layer in this stack but I could found the problem, so you need to follow the following steps to reproduce the isse.
The step 3 is the offender.
Steps to reproduce
Install a fresh Symfony app following the dunglas/symfony-docker instructions and run the app on dev environment
Stop the app with docker compose down
Change the file frankenphp/conf.d/app.prod.ini and provide a nonexistent file to opcache.preload (eg. /foo/bar.php)
Rebuild the image to prod env: docker compose -f compose.yaml -f compose.prod.yaml build --no-cache
Provide JWT keys on compose.prod.yaml
Run the app for production: docker compose -f compose.yaml -f compose.prod.yaml up -d
After that you will see the following log on app's container:
{"level":"error","ts":1709164144.1067986,"msg":"PHP Fatal error: Uncaught Error: Call to undefined function dirname() in /app/public/index.php:5\nStack trace:\n#0 {main}\n thrown in /app/public/index.php on line 5","syslog_level":"err"}
The problem
I'm using https://github.com/dunglas/symfony-docker to setup a new Symfony project. When I provide a wrong filename to
opcache.preload
option, the PHP interpreter does not found builtin function likedirname()
. This problem happens only on production environment.I've tried to reproduce with minimum complexity layer in this stack but I could found the problem, so you need to follow the following steps to reproduce the isse.
The step 3 is the offender.
Steps to reproduce
Related issue
https://github.com/dunglas/symfony-docker/issues/578