PEAR install problem preventing correct install of Phing

I just installed PEAR (along with PHP, MySQL and Apache via XAMPP) and I keep running into a really weird problem (or maybe it’s just my inexperience :wink: – this is my first time trying to use PEAR) when I upgrade the package where the PEAR config is changed. My ultimate goal is to upgrade PEAR, then upgrade the packages that Phing depends upon, and then ultimately install Phing.

When I first install PEAR, the “pear config-show” command gives the following:

CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          C:\\Program Files\\xampp\\php
PEAR documentation directory   doc_dir          C:\\Program
                                                Files\\xampp\\php\\pear\\docs
PHP extension directory        ext_dir          C:\\Program Files\\xampp\\php\\ext
PEAR directory                 php_dir          C:\\Program Files\\xampp\\php\\pear
PEAR Installer cache directory cache_dir        C:\\Program Files\\xampp\	mp
PEAR data directory            data_dir         C:\\Program
                                                Files\\xampp\\php\\pear\\data
PHP CLI/CGI binary             php_bin          C:\\Program Files\\xampp\\php\\php.exe
PEAR test directory            test_dir         C:\\Program
                                                Files\\xampp\\php\\pear\	ests
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\\gnupg\\gpg.exe
Signature Key Directory        sig_keydir       C:\\Program Files\\xampp\\php\\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\\Program Files\\xampp\\php\\pear.ini
System Configuration File      Filename         C:\\Program
                                                Files\\xampp\\php\\pearsys.ini

This is exactly how I expect it to look. I then do a “pear update-channels” command, which executes just fine, and does not affect the pear config. However, as soon as I execute the “pear update pear” command, the configuration is rewritten as follows:

CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          C:\\Program Files\\xampp\\php
PEAR documentation directory   doc_dir          C:\\php5\\pear\\docs
PHP extension directory        ext_dir          C:\\Program Files\\xampp\\php\\ext\\
PEAR directory                 php_dir          C:\\Program Files\\xampp\\php\\pear
PEAR Installer cache directory cache_dir        C:\\WINDOWS\\TEMP\\pear\\cache
PEAR data directory            data_dir         C:\\php5\\pear\\data
PHP CLI/CGI binary             php_bin          C:\\Program Files\\xampp\\php\\php.exe
PEAR test directory            test_dir         C:\\php5\\pear\	ests
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            0
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          c:\\gnupg\\gpg.exe
Signature Key Directory        sig_keydir       C:\\WINDOWS\\pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         C:\\WINDOWS\\pear.ini
System Configuration File      Filename         C:\\WINDOWS\\pearsys.ini

I have no idea what is going on here or how to fix it. If I try to upgrade and/or install other packages at this point, they get installed all over the place and I get all kinds of errors before I even get to Phing. Can anyone help? This is really driving my nuts…

I was able to correct this problem with the following commands:

pear config-set doc_dir “C:\\Program Files\\xampp\\php\\pear\\docs”
pear config-set cache_dir “C:\\Program Files\\xampp\	mp”
pear config-set data_dir “C:\\Program Files\\xampp\\php\\pear\\data”
pear config-set test_dir “C:\\Program Files\\xampp\\php\\pear\	ests”
pear config-set sig_keydir “C:\\Program Files\\xampp\\php\\pearkeys”

I still really have no idea why this happened, but it only seemed to occur when updating the core PEAR package (a follow-up “pear upgrade-all” command worked OK). Some web searches on “pear.ini” and “pearsys.ini” shed a bit of light, but I didn’t find anything that directly addressed this issue. I guess whenever you upgrade the core PEAR package, you need to check the configuration and correct it if it gets corrupted. If anyone can clear this up, please jump in.

I also found a conflict from a previous apache install with FoxServ that may have been affecting the PEAR install. Since different apache can be installed in different locations successfully, I didn’t suspect this at first, but an older version of apache was running as a service.

To fix this problem, I uninstalled XAMPP, deleted the old verstions of apache and mysql, and before reinstalling XAMPP, issued the following commands in a command line window to remove the old services:

sc delete apache
sc delete apache2
sc delete mysql

I hope documenting the solution helps other people who have the same problem.