Skip to content

Commit e3c3c42

Browse files
author
Jérôme Loyet
committed
Add fpm.conf directive to global php.ini configuration file. It's used to specify where to find the FPM configuration file. By default it's not set and the -y runtime switch has priority. If neither fpm.conf or -y is used, FPM will try the default path PHP_SYSCONFDIR/php-fpm.conf.
TODO: add "; fpm.conf = PHP_SYSCONFDIR/php-fpm.conf" to php.ini with additional documentation. It has to be done when FPM will be included into the trunk.
1 parent 7baa1b0 commit e3c3c42

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sapi/fpm/fpm/fpm_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ typedef struct _php_cgi_globals_struct {
173173
#endif
174174
HashTable user_config_cache;
175175
char *error_header;
176+
char *fpm_conf;
176177
struct event_base *event_base;
177178
} php_cgi_globals_struct;
178179

@@ -1407,6 +1408,7 @@ PHP_INI_BEGIN()
14071408
STD_PHP_INI_ENTRY("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals)
14081409
#endif
14091410
STD_PHP_INI_ENTRY("fastcgi.error_header", NULL, PHP_INI_SYSTEM, OnUpdateString, error_header, php_cgi_globals_struct, php_cgi_globals)
1411+
STD_PHP_INI_ENTRY("fpm.conf", NULL, PHP_INI_SYSTEM, OnUpdateString, fpm_conf, php_cgi_globals_struct, php_cgi_globals)
14101412
PHP_INI_END()
14111413

14121414
/* {{{ php_cgi_globals_ctor
@@ -1426,6 +1428,7 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_
14261428
#endif
14271429
zend_hash_init(&php_cgi_globals->user_config_cache, 0, NULL, (dtor_func_t) user_config_cache_entry_dtor, 1);
14281430
php_cgi_globals->error_header = NULL;
1431+
php_cgi_globals->fpm_conf = NULL;
14291432
}
14301433
/* }}} */
14311434

@@ -1747,7 +1750,7 @@ consult the installation file that came with this distribution, or visit \n\
17471750
}
17481751
}
17491752

1750-
if (0 > fpm_init(argc, argv, fpm_config, &CGIG(event_base))) {
1753+
if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_conf), &CGIG(event_base))) {
17511754
return FAILURE;
17521755
}
17531756

0 commit comments

Comments
 (0)