diff options
author | Wez Furlong <wez@php.net> | 2003-12-06 16:04:34 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-12-06 16:04:34 +0000 |
commit | fcdda2e8f8182a38404e3e5db2bb560a9348cd17 (patch) | |
tree | 528497115f4676ae418feb8a0e1c105ecc1c440b /main/php_ini.c | |
parent | 45eb5a8d03cdf72f6fc01117ecf372236fce83f6 (diff) | |
download | php-git-fcdda2e8f8182a38404e3e5db2bb560a9348cd17.tar.gz |
Fix a problem resolving the php.ini path under win32 terminal services environment.
Remove config-file-path option from configure under win32; it is not used except to display what might have been chosen, so lets default to the getenv() thingy.
Diffstat (limited to 'main/php_ini.c')
-rw-r--r-- | main/php_ini.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/main/php_ini.c b/main/php_ini.c index f4d2d9a0f1..59d5ce7053 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -379,6 +379,32 @@ int php_init_config() strcat(php_ini_search_path, default_location); } efree(default_location); + + { + /* For people running under terminal services, GetWindowsDirectory will + * return their personal Windows directory, so lets add the system + * windows directory too */ + typedef UINT (WINAPI *get_system_windows_directory_func)(char *buffer, UINT size); + static get_system_windows_directory_func get_system_windows_directory = NULL; + HMODULE kern; + + if (get_system_windows_directory == NULL) { + kern = LoadLibrary("kernel32.dll"); + if (kern) { + get_system_windows_directory = (get_system_windows_directory_func)GetProcAddress(kern, "GetSystemWindowsDirectoryA"); + } + } + if (get_system_windows_directory != NULL) { + default_location = (char *) emalloc(MAXPATHLEN + 1); + if (0 < get_system_windows_directory(default_location, MAXPATHLEN)) { + if (*php_ini_search_path) { + strcat(php_ini_search_path, paths_separator); + } + strcat(php_ini_search_path, default_location); + } + efree(default_location); + } + } #else default_location = PHP_CONFIG_FILE_PATH; if (*php_ini_search_path) { |