Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreter does not resolve builtin functions when provide nonexistente file to opcache.preload option #1501

Open
tsantos84 opened this issue Mar 1, 2024 · 1 comment

Comments

@tsantos84
Copy link

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 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

  1. Install a fresh Symfony app following the dunglas/symfony-docker instructions and run the app on dev environment
  2. Stop the app with docker compose down
  3. Change the file frankenphp/conf.d/app.prod.ini and provide a nonexistent file to opcache.preload (eg. /foo/bar.php)
  4. Rebuild the image to prod env: docker compose -f compose.yaml -f compose.prod.yaml build --no-cache
  5. Provide JWT keys on compose.prod.yaml
  6. Run the app for production: docker compose -f compose.yaml -f compose.prod.yaml up -d
  7. 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"}

Related issue

dunglas/symfony-docker#578

@tianon
Copy link
Member

tianon commented Mar 2, 2024

This is probably true for any install of PHP, right? I don't think we change anything in our packaging / Docker image that might cause this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants