On Windows, when I run
pear config-set auto_discover 1
I get the following error
PEAR_Config::writeConfigFile fopen('C:\Windows\pear.ini','w') failed (fopen(C:\Windows\pear.ini): failed to open stream: Permission denied)
even though I had mentioned during PEAR installation that my config file was c:\pear\pear.ini.
How to fix this, please (without running PEAR in admin mode or changing the permissions of c:\windows\pear.ini)? I guess my problem will be solved if I can figure out where PEAR is getting the directory for pear.ini from.
Thanks!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With