php / php/php-src

flush() halts script after fastcgi_finish_request()

Open
#9,741 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Output Feature SAPI: fpm
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

FPM/FastCGI Apache 2.4.54

<?php

fastcgi_finish_request();
flush(); // script halts after calling this function somewhere or here
file_put_contents(__DIR__.'/test.txt', microtime(TRUE), FILE_APPEND | LOCK_EX);
?>
PHP Version

PHP 7.4.30

Operating System

Linux 3.10.0-1062.12.1.el7.x86_64 Apache 2.4.54

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided script with PHP 7.4.30 under FPM/FastCGI and Apache 2.4.54 on Linux, then observe whether execution continues after fastcgi_finish_request() and flush(). Confirm the expected behavior by checking whether test.txt receives the timestamp, and investigate the runtime boundary where the script stops.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, linux, php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.