mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
- Fixed #52045 (FPM tries to open php.ini from the current dir)
- Add php_ini_ignore_cwd to _sapi_module_struct
This commit is contained in:
parent
b896c87bb5
commit
e1b87cce1f
@ -251,6 +251,7 @@ struct _sapi_module_struct {
|
||||
char *executable_location;
|
||||
|
||||
int php_ini_ignore;
|
||||
int php_ini_ignore_cwd; /* don't look for php.ini in the current directory */
|
||||
|
||||
int (*get_fd)(int *fd TSRMLS_DC);
|
||||
|
||||
|
@ -461,7 +461,7 @@ int php_init_config(TSRMLS_D)
|
||||
#endif
|
||||
|
||||
/* Add cwd (not with CLI) */
|
||||
if (strcmp(sapi_module.name, "cli") != 0) {
|
||||
if (!sapi_module.php_ini_ignore_cwd) {
|
||||
if (*php_ini_search_path) {
|
||||
strlcat(php_ini_search_path, paths_separator, search_path_size);
|
||||
}
|
||||
|
@ -734,6 +734,7 @@ int main(int argc, char *argv[])
|
||||
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
|
||||
cli_sapi_module.php_ini_path_override = NULL;
|
||||
cli_sapi_module.phpinfo_as_text = 1;
|
||||
cli_sapi_module.php_ini_ignore_cwd = 1;
|
||||
sapi_startup(&cli_sapi_module);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
|
@ -1566,6 +1566,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
sapi_startup(&cgi_sapi_module);
|
||||
cgi_sapi_module.php_ini_path_override = NULL;
|
||||
cgi_sapi_module.php_ini_ignore_cwd = 1;
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
_fmode = _O_BINARY; /* sets default for file streams to binary */
|
||||
|
Loading…
Reference in New Issue
Block a user