return -1;
}
- if (free) efree(filename);
-
if (0 > fpm_conf_post_process()) {
zlog(ZLOG_ERROR, "failed to post process the configuration");
+ if (free) efree(filename);
return -1;
}
+ if (fpm_globals.test_conf) {
+ zlog(ZLOG_NOTICE, "configuration file %s test is successful\n", filename);
+ if (free) efree(filename);
+ return -1;
+ }
+
+ if (free) efree(filename);
+
if (0 > fpm_cleanup_add(FPM_CLEANUP_ALL, fpm_conf_cleanup, 0)) {
return -1;
}
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
{'v', 0, "version"},
{'y', 1, "fpm-config"},
+ {'t', 0, "test"},
{'-', 0, NULL} /* end of args */
};
prog = "php";
}
- php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-y <file>]\n"
+ php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-c <file>] [-d foo[=bar]] [-y <file>]\n"
" -c <path>|<file> Look for php.ini file in this directory\n"
" -n No php.ini file will be used\n"
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
" -m Show compiled in modules\n"
" -v Version number\n"
" -y, --fpm-config <file>\n"
- " Specify alternative path to FastCGI process manager config file.\n",
+ " Specify alternative path to FastCGI process manager config file.\n"
+ " -t, --test Test FPM configuration and exit\n",
prog);
}
/* }}} */
CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO;
break;
+ case 't':
+ fpm_globals.test_conf = 1;
+ break;
+
case 'm': /* list compiled in modules */
cgi_sapi_module.startup(&cgi_sapi_module);
php_output_activate(TSRMLS_C);
Specify alternative path to FastCGI process manager configuration file (the default is @php_fpm_sysconfdir@/php-fpm.conf)
.TP
.PD 0
+.B \-\-test
+.TP
+.PD 1
+.B \-t
+Test FPM configuration file and exit
+.TP
+.PD 0
.B \-\-zend\-extension \fIfile\fP
.TP
.PD 1