1--TEST--
2FPM: bug68207 - fastcgi.error_header setting headers after sent
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
23echo 1;
24fastcgi_finish_request();
25d();
26EOT;
27
28$tester = new FPM\Tester($cfg, $code);
29$tester->start(iniEntries: ['fastcgi.error_header' => '"HTTP/1.1 550 PHP Error"']);
30$tester->expectLogStartNotices();
31$tester->request()->expectBody('1');
32$tester->terminate();
33$tester->expectLogTerminatingNotices();
34$tester->expectNoLogPattern('/Cannot modify header information/');
35$tester->close();
36
37?>
38Done
39--EXPECT--
40Done
41--CLEAN--
42<?php
43require_once "tester.inc";
44FPM\Tester::clean();
45?>
46