PHP: PEAR on windows tries to open c:\windows\pear.ini for writing even though the configuration file is c:\pear\pear.ini PHP: PEAR on windows tries to open c:\windows\pear.ini for writing even though the configuration file is c:\pear\pear.ini windows windows

PHP: PEAR on windows tries to open c:\windows\pear.ini for writing even though the configuration file is c:\pear\pear.ini


In the PEAR installation, when I got to the step of modifying the paths I changed the path for pear.ini from C:\Windows\pear.ini to $prefix\pear.ini and I still ran into this same error. Apparently the installation script did not update everything that it needed to.

Based on a comment on a bug report for PEAR (http://pear.php.net/bugs/bug.php?id=16939), I added an environment variable PHP_PEAR_SYSCONF_DIR to point to my PEAR install folder (C:\php\PEAR).

I am now able to successfully run the same config-set command that you were initially attempting to run.

Note the follow-on comment on the bug report however. I only needed one PEAR installation on my machine whereas you may need multiple installations.


I was able to fix this by opening the command prompt as administrator. This is done by right-clicking on the command prompt icon and selecting 'Run as Administrator'. Once command prompt is open, navigate to your php directory and run: php go-pear.phar again. Should run without an issue.

The issue is, when you open your command prompt, your current account doesn't have the privilege to write to your windows directory. Running your command prompt as administrator, will allow for writing to c:\windows

Hope this helps.