I have a combination of Nginx and PHP-FPM, and I want to set the max execution time on the PHP level to be the same as on Nginx. So I add max_execution_time=30
but it does not work.
If I create an endpoint with the logic like this:
foreach (range(1, 50) as $i) {
sleep(1);
if ($i > 40) {
$this->logger->error('Processing request', ['i' => $i]);
continue;
}
if ($i > 20) {
$this->logger->warning('Processing request', ['i' => $i]);
continue;
}
$this->logger->info('Processing request', ['i' => $i]);
}
$this->logger->info('Request processed');
and running that script after 30 seconds I see 504 from Nginx, but PHP still processing the request and writing logs. What I’m doing wrong?