I\'ve downloaded the ZIP archive of PHP and extracted it under my profile. I then needed some PEAR packages. go-pear.bat apparently installed PEAR just fine, I just
A slightly better option than michael h's answer might be:
Open $prefix\pear\PEAR\Config.php where $prefix is the value used in the PEAR installer. (On my Windows system, $prefix was C:\php\5.4.0)
Find the section below:
if (getenv('PHP_PEAR_SYSCONF_DIR')) {
define('PEAR_CONFIG_SYSCONFDIR', getenv('PHP_PEAR_SYSCONF_DIR'));
} elseif (getenv('SystemRoot')) {
define('PEAR_CONFIG_SYSCONFDIR', getenv('SystemRoot'));
} else {
define('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR);
}
And make the following changes:
if (getenv('PHP_PEAR_SYSCONF_DIR')) {
define('PEAR_CONFIG_SYSCONFDIR', getenv('PHP_PEAR_SYSCONF_DIR'));
//} elseif (getenv('SystemRoot')) {
//define('PEAR_CONFIG_SYSCONFDIR', getenv('SystemRoot'));
} else {
//define('PEAR_CONFIG_SYSCONFDIR', PHP_SYSCONFDIR);
// This next line is new
define('PEAR_CONFIG_SYSCONFDIR', $PEAR_INSTALL_DIR);
}
This solution is less hazard-prone when dealing with multiple PHP/PEAR versions/installations, especially when running more than one at the same time, as you avoid environment clobbering.
Apparently the PEAR developers overlooked the fact that WINDOWS, Program Files and friends have been deprecated as application-data directories since Windows Vista, and are generally no longer writable by non-elevated applications. (For good security reasons.)