1--TEST--
2FPM: gh9981 - fastcgi.error_header is not reset
3--SKIPIF--
4<?php
5include "skipif.inc"; ?>
6--FILE--
7<?php
8
9require_once "tester.inc";
10
11$cfg = <<<EOT
12[global]
13error_log = {{FILE:LOG}}
14[unconfined]
15listen = {{ADDR}}
16pm = static
17pm.max_children = 1
18catch_workers_output = yes
19EOT;
20
21$code = <<<EOT
22<?php
23if (isset(\$_GET['q'])) {
24    echo 'ok';
25} else {
26    d();
27}
28EOT;
29
30$tester = new FPM\Tester($cfg, $code);
31$tester->start(iniEntries: [
32    'fastcgi.error_header' => '"HTTP/1.1 500 PHP Error"',
33    'output_buffering'     => 4096,
34]);
35$tester->expectLogStartNotices();
36$tester->request()->expectStatus('500 PHP Error');
37$tester->request('q=1')->expectNoStatus();
38$tester->terminate();
39$tester->expectLogTerminatingNotices();
40$tester->expectNoLogPattern('/Cannot modify header information/');
41$tester->close();
42
43?>
44Done
45--EXPECT--
46Done
47--CLEAN--
48<?php
49require_once "tester.inc";
50FPM\Tester::clean();
51?>
52