PEARをインストール


curlでgo-pearを取ってくる

$ curl http://pear.php.net/go-pear > go-pear.php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 87670  100 87670    0     0   8391      0  0:00:10  0:00:10 --:--:--  4929

go-pearを実行

warning出てるけど...だいじょぶかな...。

$ sudo php -q go-pear.php
Welcome to go-pear!

Go-pear will install the 'pear' command and all the files needed by
it.  This command is your tool for PEAR installation and maintenance.

Go-pear also lets you download and install the following optional PEAR
packages: PEAR_Frontend_Web-beta, PEAR_Frontend_Gtk2, MDB2.


If you wish to abort, press Control-C now, or press Enter to continue: 

HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none:: 

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 prefix ($prefix) : /Users/void
 2. Temporary files directory     : $prefix/temp
 3. Binaries directory            : $prefix/bin
 4. PHP code directory ($php_dir) : $prefix/PEAR
 5. Documentation base directory  : $php_dir/docs
 6. Data base directory           : $php_dir/data
 7. Tests base directory          : $php_dir/tests

1-7, 'all' or Enter to continue: 1
Installation prefix ($prefix) [/Users/void] : /opt/local

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 prefix ($prefix) : /opt/local
 2. Temporary files directory     : $prefix/temp
 3. Binaries directory            : $prefix/bin
 4. PHP code directory ($php_dir) : $prefix/PEAR
 5. Documentation base directory  : $php_dir/docs
 6. Data base directory           : $php_dir/data
 7. Tests base directory          : $php_dir/tests

1-7, 'all' or Enter to continue: 

The following PEAR packages are bundled with PHP: PEAR_Frontend_Web-beta,
PEAR_Frontend_Gtk2, MDB2.
Would you like to install these as well? [Y/n] : 

Loading zlib: ok

Bootstrapping Installer...................
Bootstrapping PEAR.php............(remote) ok
Bootstrapping Archive/Tar.php............(remote) ok
Bootstrapping Console/Getopt.php............(remote) ok

Extracting installer..................
Downloading package: PEAR.............ok
Downloading package: Structures_Graph....ok

Preparing installer..................
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

Installing selected packages..................
Downloading and installing package: PEAR.............warning: pear/PEAR requires package "pear/Archive_Tar" (recommended version 1.3.2)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
downloading PEAR-1.7.2.tgz ...
Starting to download PEAR-1.7.2.tgz (302,744 bytes)
..............................................................done: 302,744 bytes
install ok: channel://pear.php.net/PEAR-1.7.2
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"
Installing bootstrap package: Structures_Graph.......install ok: channel://pear.php.net/Structures_Graph-1.0.2
Downloading and installing package: Archive_Tar-stable.......downloading Archive_Tar-1.3.2.tgz ...
Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes)
...done: 17,150 bytes
install ok: channel://pear.php.net/Archive_Tar-1.3.2
Downloading and installing package: Console_Getopt-stable.......downloading Console_Getopt-1.2.3.tgz ...
Starting to download Console_Getopt-1.2.3.tgz (4,011 bytes)
...done: 4,011 bytes
install ok: channel://pear.php.net/Console_Getopt-1.2.3
Downloading and installing package: PEAR_Frontend_Web-beta.......downloading PEAR_Frontend_Web-0.7.3.tgz ...
Starting to download PEAR_Frontend_Web-0.7.3.tgz (53,152 bytes)
...done: 53,152 bytes
downloading HTML_Template_IT-1.2.1.tgz ...
Starting to download HTML_Template_IT-1.2.1.tgz (21,565 bytes)
...done: 21,565 bytes
install ok: channel://pear.php.net/HTML_Template_IT-1.2.1
install ok: channel://pear.php.net/PEAR_Frontend_Web-0.7.3
Downloading and installing package: PEAR_Frontend_Gtk2.......Did not download optional dependencies: pear/XML_Parser, pear/XML_Util, use --alldeps to download automatically
Did not download optional dependencies: pear/System_Command, use --alldeps to download automatically
pear/PEAR_Frontend_Gtk2 requires PHP extension "php-gtk" (version >= 2.0.0dev)
pear/Config can optionally use package "pear/XML_Parser"
pear/Config can optionally use package "pear/XML_Util"
pear/Gtk2_EntryDialog requires PHP extension "php-gtk" (version >= 2.0.0dev)
pear/Gtk2_FileDrop requires PHP extension "php-gtk" (version >= 2.0.0dev)
pear/MIME_Type can optionally use package "pear/System_Command"
downloading Config-1.10.11.tgz ...
Starting to download Config-1.10.11.tgz (27,939 bytes)
...done: 27,939 bytes
downloading MIME_Type-1.2.0.tgz ...
Starting to download MIME_Type-1.2.0.tgz (11,581 bytes)
...done: 11,581 bytes
install ok: channel://pear.php.net/Config-1.10.11
install ok: channel://pear.php.net/MIME_Type-1.2.0
Downloading and installing package: MDB2.............downloading MDB2-2.4.1.tgz ...
Starting to download MDB2-2.4.1.tgz (119,790 bytes)
...done: 119,790 bytes
install ok: channel://pear.php.net/MDB2-2.4.1
MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
MDB2: Optional feature mysql available (MySQL driver for MDB2)
MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
MDB2: Optional feature oci8 available (Oracle driver for MDB2)
MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
MDB2: Optional feature querysim available (Querysim driver for MDB2)
MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
MDB2: To install optional features use "pear install pear/MDB2#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:

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 ? [Y/n] : 

php.ini  include_path updated.

Current include path           : .:/opt/PEAR:/Users/void/PEAR
Configured directory           : /opt/local/PEAR
Currently used php.ini (guess) : /private/etc/php.ini
Press Enter to continue: 

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

必要ないファイルを消しておく

$ rm go-pear

return