Open ochorocho opened 8 months ago
Is $_SERVER['MAX_REQUESTS']
actually set to something? I usually just hardcode a number as a default in case it isn't set, but in your code that is missing. So, it is probably being cast to a 0
since that is the default when casting null
.
@withinboredom thanks, now it works.
Worker script now is set to
FRANKENPHP_CONFIG="worker ./public/index.php"
index.php
minimal example:
use Symfony\Component\HttpFoundation\Response;
ignore_user_abort(true);
$classLoader = require dirname(__DIR__).'/vendor/autoload.php';
// Handler outside the loop for better performance (doing less work)
$handler = static function () {
echo new Response("Hello World!", 200);
};
for ($nbRequests = 0, $running = true; ($nbRequests < (10)) && $running; ++$nbRequests) {
$running = \frankenphp_handle_request($handler);
// What to do with the $app here?
// $app->terminate();
gc_collect_cycles();
}
When the worker script was set to public/worker.php
for some reason it still called the public/index.php
.
No idea if this is intended. Was just wondering it this is expected behaviour.
Was just wondering it this is expected behaviour.
Heh, smells exactly like #100. I don't know if it is intended, but its been that way forever. I think its just that the (default) script and (worker) script have to be the same file.
I tried to get TYPO3 working in worker mode. I used the Custom Apps as a base.
This is what i have so far:
Here my questions:
terminate();
andshtudown();
to do something specific?Output of
frankenphp run -c Caddyfile --envfile .env
:Here is my playground project: https://gitlab.knallimall.org/ochorocho/franky
Thank you. :-)