PHP組込み関数直コールってのも勉強には良いが、まとまった何かを開発するとなると辛い。そこで便利なものをどんどん使おう、ということでPEAR(PHP Extension and Application Repository)をインストール。
現時点で400個以上のパッケージが公開されている。ありがたや、ありがたや。
PEAR自体は「sudo apt-get install php-pear」でインストールする。PEARパッケージのインストールその他は「pear」コマンドを使う。
$ sudo pear install DB /tmp/glibctest8Tjfp8:1:22: error: features.h: No such file or directory downloading DB-1.7.11.tgz ... Starting to download DB-1.7.11.tgz (132,064 bytes) .............................done: 132,064 bytes install ok: channel://pear.php.net/DB-1.7.11 $ sudo pear install mdb2 /tmp/glibctestjOjMv1:1:22: error: features.h: No such file or directory 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) To install use "pear install pear/MDB2#featurename" $ sudo pear install MDB2_Driver_mysql /tmp/glibctestS6lHqn:1:22: error: features.h: No such file or directory downloading MDB2_Driver_mysql-1.4.1.tgz ... Starting to download MDB2_Driver_mysql-1.4.1.tgz (36,481 bytes) ..........done: 36,481 bytes install ok: channel://pear.php.net/MDB2_Driver_mysql-1.4.1
glibc関係のエラーが出てるけどインストール自体はできるのでいまは気にせず使うことにする。
PEARは「ペア」と読むらしい。「ぴあ」かと思ってた。