diff options
author | Hartmut Holzgraefe <hholzgra@php.net> | 2005-07-27 15:12:18 +0000 |
---|---|---|
committer | Hartmut Holzgraefe <hholzgra@php.net> | 2005-07-27 15:12:18 +0000 |
commit | 7e071d9a1f9c254448e78686f056390494a2deac (patch) | |
tree | f7850f4ea204d6615b4c62bcefc519343af4b162 /main/php_ini.c | |
parent | 3674649c5925ad488a7873688099d7b6e4ba7072 (diff) | |
download | php-git-7e071d9a1f9c254448e78686f056390494a2deac.tar.gz |
php.ini search logic needs to use the absolute path of the running binary
when looking for php.ini in the directory the php binary is installed in
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index e6dd1b8a34..452687f2d8 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -350,7 +350,11 @@ int php_init_config() } #else if (sapi_module.executable_location) { - binary_location = estrdup(sapi_module.executable_location); + binary_location = (char *)emalloc(PATH_MAX); + if (!realpath(sapi_module.executable_location, binary_location)) { + efree(binary_location); + binary_location = NULL; + } } else { binary_location = NULL; } @@ -359,7 +363,7 @@ int php_init_config() char *separator_location = strrchr(binary_location, DEFAULT_SLASH); if (separator_location) { - *(separator_location+1) = 0; + *(separator_location) = 0; } if (*php_ini_search_path) { strcat(php_ini_search_path, paths_separator); |