frankenphp
frankenphp copied to clipboard
runtime missed error
When I try to launch a Symfony project in worker mode without installing the runtime/frankenphp-symfony
library, I have this line in a loop into the log
{"level":"error","ts":1668116008.9931438,"msg":"unexpected termination, restarting","worker":"/app/public/index.php"}
To reproduce:
symfony new --full test
cd test
docker run --rm -e FRANKENPHP_CONFIG="worker ./public/index.php" -e APP_RUNTIME=Runtime\\FrankenPhpSymfony\\Runtime -p 80:80 -p 443:443 -v $(pwd):/app dunglas/frankenphp
To solve:
symfony composer req runtime/frankenphp-symfony
This is expected. The worker mode requires a long-running script handling several requests: https://github.com/dunglas/frankenphp/blob/main/docs/worker.md
runtime/frankenphp-symfony
provide this script for Symfony.
It's possible to get the most expressive message to solve the issue more quickly?
What we could do is check if frankenphp_handle_request()
has not been called, and then display a better error message, indeed.