How to change location of the pear.ini for php 5.4 and 5.5 on Windows

When PEAR installs itself on Windows it places pear.ini file in the system folder c:\Windows by default. Which sometimes needs to be changed after all. And sometimes it is not possible for some reasons (not sure why, probably a bug in PEAR installation scripts) to change this location during the installation. Then we need to change this location when PEAR is already installed and in use.

First check the current PEAR configuration pear config-show

Two last lines here show the location for PEAR configuration files that needs to be changed.

Some users reports that PEAR creates a key in Windows registry but this is not always true. And PEAR works fine without that key.

What always works is an environment variable PHP_PEAR_SYSCONF_DIR. It should points to the pear.ini file location.