frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

runtime missed error

Open macintoshplus opened this issue 2 years ago • 3 comments

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

macintoshplus avatar Nov 10 '22 21:11 macintoshplus

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.

dunglas avatar Nov 10 '22 23:11 dunglas

It's possible to get the most expressive message to solve the issue more quickly?

macintoshplus avatar Nov 15 '22 07:11 macintoshplus

What we could do is check if frankenphp_handle_request() has not been called, and then display a better error message, indeed.

dunglas avatar Nov 15 '22 21:11 dunglas