LionにPearをインストール

```zsh
% cd /tmp/
% curl http://pear.php.net/go-pear.phar > go-pear.phar
% sudo mv go-pear.phar /usr/local/
Password:
% cd /usr/local/
```

インストールするのは、/usr/local/pear以下にしたいので、途中でパスの変更は必要。

```zsh
% sudo php -d detect_unicode=0 go-pear.phar

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /Users/XXXXXX/pear
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /Users/XXXXXX/pear/bin
 5. PHP code directory ($php_dir)                 : /Users/XXXXXX/pear/share/pear
 6. Documentation directory                       : /Users/XXXXXX/pear/docs
 7. Data directory                                : /Users/XXXXXX/pear/data
 8. User-modifiable configuration files directory : /Users/XXXXXX/pear/cfg
 9. Public Web Files directory                    : /Users/XXXXXX/pear/www
10. Tests directory                               : /Users/XXXXXX/pear/tests
11. Name of configuration file                    : /Users/XXXXXX/.pearrc

1-11, 'all' or Enter to continue: 1
(Use $prefix as a shortcut for '/Users/XXXXXX/pear', etc.)
Installation base ($prefix) [/Users/XXXXXX/pear] : /usr/local/pear

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr/local/pear
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/local/pear/bin
 5. PHP code directory ($php_dir)                 : /usr/local/pear/share/pear
 6. Documentation directory                       : /usr/local/pear/docs
 7. Data directory                                : /usr/local/pear/data
 8. User-modifiable configuration files directory : /usr/local/pear/cfg
 9. Public Web Files directory                    : /usr/local/pear/www
10. Tests directory                               : /usr/local/pear/tests
11. Name of configuration file                    : /Users/XXXXXX/.pearrc

1-11, 'all' or Enter to continue: 
Beginning install...
Configuration written to /Users/XXXXXX/.pearrc...
Initialized registry...
Preparing to install...
installing phar:///usr/local/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.7.tar...
installing phar:///usr/local/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.3.0.tar...
installing phar:///usr/local/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.4.tar...
installing phar:///usr/local/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.4.tar...
installing phar:///usr/local/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.7
install ok: channel://pear.php.net/Console_Getopt-1.3.0
install ok: channel://pear.php.net/Structures_Graph-1.0.4
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.4
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
</usr/local/pear/share/pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.


Would you like to alter php.ini </private/etc/php.ini>? [Y/n] : Y

php.ini </private/etc/php.ini> include_path updated.

Current include path           : .:
Configured directory           : /usr/local/pear/share/pear
Currently used php.ini (guess) : /private/etc/php.ini
Press Enter to continue: 

** WARNING! Old version found at /usr/local/pear/bin, please remove it or be sure to use the new /usr/local/pear/bin/pear command

The 'pear' command is now at your service at /usr/local/pear/bin/pear

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/local/pear/bin/pear' until you have added
** '/usr/local/pear/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php
  http://pear.php.net/manual/

Thanks for using go-pear!
```

最後に、

```zsh
% export PATH=$PATH:/usr/local/pear/bin/
```

.zshrcとかに追加しておくのも忘れないように。

あと、ルート権限でインストールしたので、ホームディレクトリにある.pearrcファイルの権限を戻しておく

```zsh
% cd
% sudo chown XXXXX .pearrc
```