| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2002-05-29 16:52 UTC] urs@php.net
 While working with PEAR installer it occurred that the pear.ini setting file got placed in a newly created directory c:\php4. This dir is hardcoded in: http://cvs.php.net/co.php/php4/main/config.w32.h.in To respect other php installations like in c:\php or c:\programme\php one need a feature to override the constants given by the php core: http://www.php.net/manual/en/reserved.constants.core.php Since scripts in PEAR are designed using these constants, and constants are not variable, there is probably only one way to override these values in config.w32.h.in e.g. like: #define PHP_SYSCONFDIR ( (getenv("PHP_SYSCONFDIR") != "c:\\php4" ) ? getenv("PHP_SYSCONFDIR" ) : "c:\\php4" ) This allows the user to configure its paths by hand through setting the environment variables like: c:\>set PHP_SYSCONFDIR=c:\php I propose to do this switch for all path related constants in config.w32.h.in [DIRECTORY_SEPARATOR, PHP_SYSCONFDIR, DEFAULT_INCLUDE_PATH, PEAR_INSTALL_DIR, PEAR_EXTENSION_DIR, PHP_EXTENSION_DIR, PHP_BINDIR, PHP_LIBDIR, PHP_DATADIR, PHP_SYSCONFDIR, PHP_LOCALSTATEDIR, PHP_CONFIG_FILE_PATH]. -urs PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 09:00:01 2025 UTC | 
Reopened, should maybe be marked as critical: Setting the environment variables has no effect or strange effects) on PHP constants on Win32. This might be the main cause for pear installations failing on windows if php is not installed in c:\php4 (and for PEAR BETA status on Win32). In the following test script - PHP_BINDIR is set in the environment - The setting does not get reflected in the PHP constant - Mistriously it's not read correctly by getenv() test script (dos shell): ************************ set PHP_BINDIR="my_php_bindir" set PHP_BINDIR cli\php -r "echo PHP_BINDIR;" cli\php -r "echo getenv('PHP_BINDIR');"