Skip to content

Make /ping of php-fpm work again #13980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sapi/fpm/fpm/fpm_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ static int fpm_worker_pool_shared_status_alloc(struct fpm_worker_pool_s *shared_
FPM_WPC_STR_CP(config, shared_config, user);
FPM_WPC_STR_CP(config, shared_config, group);
FPM_WPC_STR_CP(config, shared_config, pm_status_path);
FPM_WPC_STR_CP(config, shared_config, ping_path);
FPM_WPC_STR_CP(config, shared_config, ping_response);

config->pm = PM_STYLE_ONDEMAND;
config->pm_max_children = 2;
Expand Down
40 changes: 40 additions & 0 deletions sapi/fpm/tests/status-ping.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--TEST--
FPM: Ping on the status invisible pool
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php

require_once "tester.inc";

$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = static
pm.max_children = 1
pm.status_listen = {{ADDR[status]}}
pm.status_path = /status
ping.path = /ping
ping.response = pong
EOT;

$tester = new FPM\Tester($cfg);
$tester->start();
$tester->expectLogStartNotices();
$tester->ping('{{ADDR[status]}}');
usleep(100000);
$tester->terminate();
$tester->expectLogTerminatingNotices();
$tester->close();

?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>
Loading