Skip to content

Commit

Permalink
- Fixed #52045 (FPM tries to open php.ini from the current dir)
Browse files Browse the repository at this point in the history
- Add php_ini_ignore_cwd to _sapi_module_struct
  • Loading branch information
Jérôme Loyet committed Nov 11, 2010
1 parent b896c87 commit e1b87cc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions main/SAPI.h
Expand Up @@ -251,6 +251,7 @@ struct _sapi_module_struct {
char *executable_location; char *executable_location;


int php_ini_ignore; 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); int (*get_fd)(int *fd TSRMLS_DC);


Expand Down
2 changes: 1 addition & 1 deletion main/php_ini.c
Expand Up @@ -461,7 +461,7 @@ int php_init_config(TSRMLS_D)
#endif #endif


/* Add cwd (not with CLI) */ /* Add cwd (not with CLI) */
if (strcmp(sapi_module.name, "cli") != 0) { if (!sapi_module.php_ini_ignore_cwd) {
if (*php_ini_search_path) { if (*php_ini_search_path) {
strlcat(php_ini_search_path, paths_separator, search_path_size); strlcat(php_ini_search_path, paths_separator, search_path_size);
} }
Expand Down
1 change: 1 addition & 0 deletions sapi/cli/php_cli.c
Expand Up @@ -734,6 +734,7 @@ int main(int argc, char *argv[])
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults; cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
cli_sapi_module.php_ini_path_override = NULL; cli_sapi_module.php_ini_path_override = NULL;
cli_sapi_module.phpinfo_as_text = 1; cli_sapi_module.phpinfo_as_text = 1;
cli_sapi_module.php_ini_ignore_cwd = 1;
sapi_startup(&cli_sapi_module); sapi_startup(&cli_sapi_module);


#ifdef PHP_WIN32 #ifdef PHP_WIN32
Expand Down
1 change: 1 addition & 0 deletions sapi/fpm/fpm/fpm_main.c
Expand Up @@ -1566,6 +1566,7 @@ int main(int argc, char *argv[])


sapi_startup(&cgi_sapi_module); sapi_startup(&cgi_sapi_module);
cgi_sapi_module.php_ini_path_override = NULL; cgi_sapi_module.php_ini_path_override = NULL;
cgi_sapi_module.php_ini_ignore_cwd = 1;


#ifdef PHP_WIN32 #ifdef PHP_WIN32
_fmode = _O_BINARY; /* sets default for file streams to binary */ _fmode = _O_BINARY; /* sets default for file streams to binary */
Expand Down

0 comments on commit e1b87cc

Please sign in to comment.