1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00

Merge branch 'PHP-5.6'

* PHP-5.6:
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
This commit is contained in:
Remi Collet
2014-11-18 17:46:15 +01:00
2 changed files with 56 additions and 1 deletions
+2 -1
View File
@@ -266,6 +266,8 @@ int fpm_unix_init_main() /* {{{ */
struct fpm_worker_pool_s *wp;
int is_root = !geteuid();
zlog_set_level(fpm_globals.log_level);
if (fpm_global_config.rlimit_files) {
struct rlimit r;
@@ -396,7 +398,6 @@ int fpm_unix_init_main() /* {{{ */
}
}
zlog_set_level(fpm_globals.log_level);
return 0;
}
/* }}} */
+54
View File
@@ -0,0 +1,54 @@
--TEST--
FPM: Test for log_level in fpm_unix_init_main #68381
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php
include "include.inc";
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
$port = 9000+PHP_INT_SIZE;
$cfg = <<<EOT
[global]
error_log = $logfile
log_level = warning
[unconfined]
listen = 127.0.0.1:$port
user = foo
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
EOT;
$fpm = run_fpm($cfg, $tail);
if (is_resource($fpm)) {
$i = 0;
while (($i++ < 30) && !($fp = @fsockopen('127.0.0.1', $port))) {
usleep(10000);
}
if ($fp) {
echo "Started\n";
fclose($fp);
}
proc_terminate($fpm);
if (!feof($tail)) {
echo stream_get_contents($tail);
}
fclose($tail);
proc_close($fpm);
}
?>
Done
--EXPECTF--
Started
Done
--CLEAN--
<?php
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
@unlink($logfile);
?>