重新安装PHP Pear

I used to have MAMP (http://www.mamp.info/en/index.html). Uninstalled that and installed "MAMP" via Macports.

I completely removed /Applications/MAMP/ folders. I would now like to install PHPUnit via pear.

Pear is installed:

> which pear
/opt/local/bin/pear

> pear config-show
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          /Applications/MAMP/bin/php/php5.3.6/bin/
PEAR documentation directory   doc_dir          /Applications/MAMP/bin/php5.3/docs
PHP extension directory        ext_dir          /opt/local/lib/php/extensions/no-debug-non-zts-20090626
PEAR directory                 php_dir          /Applications/MAMP/bin/php5.3/share/pear
PEAR Installer cache directory cache_dir        /private/tmp/pear/cache
PEAR configuration file        cfg_dir          /Applications/MAMP/bin/php5.3/cfg
directory
PEAR data directory            data_dir         /Applications/MAMP/htdocs/pear
PEAR Installer download        download_dir     /tmp/pear/install
directory
PHP CLI/CGI binary             php_bin          /opt/local/bin/php
php.ini location               php_ini          <not set>
--program-prefix passed to     php_prefix       <not set>
PHP's ./configure
--program-suffix passed to     php_suffix       <not set>
PHP's ./configure
PEAR Installer temp directory  temp_dir         /tmp/pear/install
PEAR test directory            test_dir         /Applications/MAMP/bin/php5.3/tests
PEAR www files directory       www_dir          /Applications/MAMP/bin/php5.3/www
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            22
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          /usr/local/bin/gpg
Signature Key Directory        sig_keydir       /opt/local/etc/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         /Users/*removed*/.pearrc
System Configuration File      Filename         /opt/local/etc/pear.conf

There are lots of references to /Applications/MAMP/ folder structure which I had deleted (and mysteriously keeps regenerating). I would like to remove all these references but not sure what substitute values should be. I cannot seem to uninstall pear or upgrade pear.

Ideally I would like a situation where pear remains installed and PHPUnit is installed so that I can run some tests.

You can adjust those config values with pear config-set, for example

$ pear config-set php_dir /usr/share/pear/php
$ pear config-set data_dir /usr/share/pear/data

Do that for all config values with "broken" paths.

After that, either manually move the files from the old to the new directories, or reinstall all packages.