-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
Call to undefined function dirname() #578
Comments
@tsantos84 hello! Can you show content of your |
Sure. <?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
}; But, after debugging the problem I found that |
Yes, but having Opcache still has benefits (faster worker boot time etc), and that's a very weird issue. Are you able to provide a reproducer? That would be nice to report this issue to PHP. |
Sure, I will try to create a reproducer. Basically the same Dockerfile, it means based on |
Anything allowing them to reproduce would likely interest them! |
Could you check if switching to Debian fixes the issue by the way? Moving to Debian is on the roadmap: #555 |
@dunglas , I've found the issue. The problem happens when we provide a nonexistent file to I've managed to reproduce the issue by using this repo and make a small change on it. The
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"} |
No, the weird behavior happens on Debian as well. I've tried to build an official PHP image, install opcache and provide a wrong filename for I don't know if the issue resides on Let me know if I should open an issue directly on Frankenphp repository or official PHP. |
I think that official PHP is more appropriate. |
I'm adapting an existing Symfony 7 application to use Docker + Frankenphp based on your setup. The
dev
environment works nicely but when I try to run theprod
environment, which uses workers to handle the requests, I'm getting the strange errorPHP Fatal error: Uncaught Error: Call to undefined function dirname() in /app/public/index.php
. This is strange becausedirname
is a built-in PHP's function.Full error:
Caddyfile:
worker.Caddyfile
FRANKENPHP_CONFIG
FRANKENPHP_CONFIG="import worker.Caddyfile"
Dockerfile
The text was updated successfully, but these errors were encountered: