Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
php.ini search logic needs to use the absolute path of the running bi…
…nary

when looking for php.ini in the directory the php binary is installed in
  • Loading branch information
Hartmut Holzgraefe committed Jul 27, 2005
1 parent 3674649 commit 7e071d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main/php_ini.c
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 7e071d9

Please sign in to comment.