xref: /PHP-5.6/sapi/fpm/tests/014.phpt (revision a128cbad)
1--TEST--
2FPM: Test for pm.start_servers default calculation message being a notice and not a warning #68458
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
22;pm.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++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
31		usleep(10000);
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?>