pearのパッケージを追加する
pearで使用するパッケージをインストールするには「pear install パッケージ名」を実行します。
まずは現在のパッケージを確認します。
1 2 3 4 5 6 7 8 9 10 |
# pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.4.3 stable Console_Getopt 1.4.1 stable PEAR 1.10.5 stable Structures_Graph 1.1.1 stable XML_Util 1.4.2 stable # |
今回は以下をインストールします。
- XML_Parser
- Net_URL
- HTTP_Request
- XML_Serializer
- Mail_mimeDecode
- mail_queue
- MDB2
- MDB2#mysql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# pear install XML_Parser WARNING: "pear/XML_Parser" is deprecated in favor of "pear/XML_Parser2" WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update downloading XML_Parser-1.3.7.tgz ... Starting to download XML_Parser-1.3.7.tgz (13,339 bytes) .....done: 13,339 bytes install ok: channel://pear.php.net/XML_Parser-1.3.7 # # pear install Net_URL WARNING: "pear/Net_URL" is deprecated in favor of "pear/Net_URL2" WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update downloading Net_URL-1.0.15.tgz ... Starting to download Net_URL-1.0.15.tgz (6,393 bytes) .....done: 6,393 bytes install ok: channel://pear.php.net/Net_URL-1.0.15 # # pear install HTTP_Request WARNING: "pear/HTTP_Request" is deprecated in favor of "pear/HTTP_Request2" WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update WARNING: "pear/Net_URL" is deprecated in favor of "pear/Net_URL2" downloading HTTP_Request-1.4.4.tgz ... Starting to download HTTP_Request-1.4.4.tgz (17,233 bytes) ......done: 17,233 bytes downloading Net_Socket-1.2.2.tgz ... Starting to download Net_Socket-1.2.2.tgz (6,903 bytes) ...done: 6,903 bytes install ok: channel://pear.php.net/Net_Socket-1.2.2 install ok: channel://pear.php.net/HTTP_Request-1.4.4 # |
「XML_Serializer」がインストールに失敗するので、「XML_Serializer-0.20.2」を代わりにインストールします。
1 2 3 4 5 6 7 8 9 10 11 12 |
# pear install XML_Serializer Failed to download pear/XML_Serializer within preferred state "stable", latest release is version 0.21.0, stability "beta", use "channel://pear.php.net/XML_Serializer-0.21.0" to install install failed # # pear install XML_Serializer-0.20.2 WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update WARNING: "pear/XML_Parser" is deprecated in favor of "pear/XML_Parser2" downloading XML_Serializer-0.20.2.tgz ... Starting to download XML_Serializer-0.20.2.tgz (36,129 bytes) ..........done: 36,129 bytes install ok: channel://pear.php.net/XML_Serializer-0.20.2 # |
「-a」をつけると依存関係を考慮してインストールしてくれます。
まずは現在のインストール状況を表示しましょう。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.4.3 stable Console_Getopt 1.4.1 stable HTTP_Request 1.4.4 stable Net_Socket 1.2.2 stable Net_URL 1.0.15 stable PEAR 1.10.5 stable Structures_Graph 1.1.1 stable XML_Parser 1.3.7 stable XML_Serializer 0.20.2 beta XML_Util 1.4.2 stable # |
「-a」をつけてインストールしてみます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# pear install -a Mail WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update WARNING: "pear/Auth_SASL" is deprecated in favor of "pear/Auth_SASL2" downloading Mail-1.4.1.tgz ... Starting to download Mail-1.4.1.tgz (21,756 bytes) ........done: 21,756 bytes downloading Net_SMTP-1.8.0.tgz ... Starting to download Net_SMTP-1.8.0.tgz (14,399 bytes) ...done: 14,399 bytes downloading Auth_SASL-1.1.0.tgz ... Starting to download Auth_SASL-1.1.0.tgz (9,380 bytes) ...done: 9,380 bytes install ok: channel://pear.php.net/Mail-1.4.1 install ok: channel://pear.php.net/Net_SMTP-1.8.0 install ok: channel://pear.php.net/Auth_SASL-1.1.0 # # # pear install -a Mail_mimeDecode WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update downloading Mail_mimeDecode-1.5.6.tgz ... Starting to download Mail_mimeDecode-1.5.6.tgz (13,258 bytes) .....done: 13,258 bytes downloading Mail_Mime-1.10.1.tgz ... Starting to download Mail_Mime-1.10.1.tgz (36,336 bytes) ...done: 36,336 bytes install ok: channel://pear.php.net/Mail_Mime-1.10.1 install ok: channel://pear.php.net/Mail_mimeDecode-1.5.6 # pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.4.3 stable Auth_SASL 1.1.0 stable Console_Getopt 1.4.1 stable HTTP_Request 1.4.4 stable Mail 1.4.1 stable Mail_Mime 1.10.1 stable Mail_mimeDecode 1.5.6 stable Net_SMTP 1.8.0 stable Net_Socket 1.2.2 stable Net_URL 1.0.15 stable PEAR 1.10.5 stable Structures_Graph 1.1.1 stable XML_Parser 1.3.7 stable XML_Serializer 0.20.2 beta XML_Util 1.4.2 stable # # |
「Auth_SASL」や「Net_SMTP」などが追加されたことがわかります。
更に追加します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# pear install mail_queue WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update Unknown remote channel: pear.phpdb.org WARNING: "pear/DB" is deprecated in favor of "pear/MDB2" Unknown remote channel: pear.phpdb.org WARNING: "pear/MDB" is deprecated in favor of "pear/MDB2" Did not download optional dependencies: channel://pear.phpdb.org/creole, pear/DB, channel://pear.phpdb.org/jargon, pear/MDB, pear/MDB2, use --alldeps to download automatically pear/Mail_Queue can optionally use package "channel://pear.phpdb.org/creole" pear/Mail_Queue can optionally use package "pear/DB" pear/Mail_Queue can optionally use package "channel://pear.phpdb.org/jargon" pear/Mail_Queue can optionally use package "pear/MDB" pear/Mail_Queue can optionally use package "pear/MDB2" downloading Mail_Queue-1.2.7.tgz ... Starting to download Mail_Queue-1.2.7.tgz (22,212 bytes) ........done: 22,212 bytes install ok: channel://pear.php.net/Mail_Queue-1.2.7 # # # pear install MDB2 WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update downloading MDB2-2.4.1.tgz ... Starting to download MDB2-2.4.1.tgz (121,557 bytes) .....done: 121,557 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" # # # pear install MDB2#mysql WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update Skipping package "pear/MDB2", already installed as version 2.4.1 downloading MDB2_Driver_mysql-1.4.1.tgz ... Starting to download MDB2_Driver_mysql-1.4.1.tgz (36,787 bytes) ..........done: 36,787 bytes install ok: channel://pear.php.net/MDB2_Driver_mysql-1.4.1 # |
最終的に以下のような状況になりました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.4.3 stable Auth_SASL 1.1.0 stable Console_Getopt 1.4.1 stable HTTP_Request 1.4.4 stable MDB2 2.4.1 stable MDB2_Driver_mysql 1.4.1 stable Mail 1.4.1 stable Mail_Mime 1.10.1 stable Mail_Queue 1.2.7 stable Mail_mimeDecode 1.5.6 stable Net_SMTP 1.8.0 stable Net_Socket 1.2.2 stable Net_URL 1.0.15 stable PEAR 1.10.5 stable Structures_Graph 1.1.1 stable XML_Parser 1.3.7 stable XML_Serializer 0.20.2 beta XML_Util 1.4.2 stable # |