xref: /PHP-7.0/sapi/fpm/tests/013.phpt (revision fd92b911)
1--TEST--
2FPM: Test for log_level in fpm_unix_init_main #68381
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8include "include.inc";
9
10$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
11$port = 9000+PHP_INT_SIZE;
12
13$cfg = <<<EOT
14[global]
15error_log = $logfile
16log_level = warning
17[unconfined]
18listen = 127.0.0.1:$port
19user = foo
20pm = dynamic
21pm.max_children = 5
22pm.start_servers = 2
23pm.min_spare_servers = 1
24pm.max_spare_servers = 3
25EOT;
26
27$fpm = run_fpm($cfg, $tail);
28if (is_resource($fpm)) {
29    $i = 0;
30	while (($i++ < 60) && !($fp = @fsockopen('127.0.0.1', $port))) {
31		usleep(50000);
32	}
33	if ($fp) {
34		echo "Started\n";
35		fclose($fp);
36	}
37	proc_terminate($fpm);
38	if (!feof($tail)) {
39		echo stream_get_contents($tail);
40	}
41	fclose($tail);
42	proc_close($fpm);
43}
44
45?>
46Done
47--EXPECTF--
48Started
49Done
50--CLEAN--
51<?php
52	$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
53	@unlink($logfile);
54?>
55