From d24cd92a22131a613e8140020020da5458506013 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Loyet?= Date: Sun, 9 Oct 2011 14:36:11 +0000 Subject: [PATCH] - Fixed bug #55533 (The -d parameter doesn't work) --- sapi/fpm/fpm/fpm_main.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 752a8c85d4..a9298e7573 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1521,6 +1521,7 @@ int main(int argc, char *argv[]) char *fpm_prefix = NULL; char *fpm_pid = NULL; int test_conf = 0; + int php_information = 0; #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) @@ -1632,20 +1633,8 @@ int main(int argc, char *argv[]) goto out; case 'i': /* php info & quit */ - cgi_sapi_module.phpinfo_as_text = 1; - cgi_sapi_module.startup(&cgi_sapi_module); - if (php_request_startup(TSRMLS_C) == FAILURE) { - SG(server_context) = NULL; - php_module_shutdown(TSRMLS_C); - return FAILURE; - } - SG(headers_sent) = 1; - SG(request_info).no_headers = 1; - php_print_info(0xFFFFFFFF TSRMLS_CC); - php_request_shutdown((void *) 0); - fcgi_shutdown(); - exit_status = 0; - goto out; + php_information = 1; + break; default: case 'h': @@ -1682,6 +1671,23 @@ int main(int argc, char *argv[]) } } + if (php_information) { + cgi_sapi_module.phpinfo_as_text = 1; + cgi_sapi_module.startup(&cgi_sapi_module); + if (php_request_startup(TSRMLS_C) == FAILURE) { + SG(server_context) = NULL; + php_module_shutdown(TSRMLS_C); + return FAILURE; + } + SG(headers_sent) = 1; + SG(request_info).no_headers = 1; + php_print_info(0xFFFFFFFF TSRMLS_CC); + php_request_shutdown((void *) 0); + fcgi_shutdown(); + exit_status = 0; + goto out; + } + /* No other args are permitted here as there is no interactive mode */ if (argc != php_optind) { cgi_sapi_module.startup(&cgi_sapi_module); -- 2.50.1