LoginSignup
17
16

More than 5 years have passed since last update.

PEARのインストール方法

Posted at

コードスニファー入れるにあたりPEARが必要になったので入れた。「ぴあ」じゃなくて「ぺあ」って読むんだぜこれ。

PEARとは

PHPで利用する事ができるライブラリのリポジトリ。ネットワークからライブラリをインストールできる。

インストール

環境

Mac OSX 10.9.5

PEARのインストール

$ sudo php /usr/lib/php/install-pear-nozlib.phar

以下のメッセージがでる。

Password:
[PEAR] Archive_Tar    - installed: 1.3.7
[PEAR] Console_Getopt - installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util       - installed: 1.2.1
[PEAR] PEAR           - installed: 1.9.2
Wrote PEAR system config file at: /private/etc/pear.conf
You may want to add: /usr/lib/php/pear to your php.ini include_path

php.iniの作成

/etc/php.iniのファイルが存在するかどうか確認。存在しなければ以下を実行してコピーする。

$ sudo cp /etc/php.ini.default /etc/php.ini

パス指定

追加前

php.ini
include_path = ".:/php/includes"

追加後

php.ini
include_path = ".:/php/includes:/usr/lib/php/pear"

試してみる

試しに以下のコマンドを打ってみる。

$ sudo pear list

成功したら以下のようにインストールされてるパッケージの一覧が表示される。

Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.7   stable
Console_Getopt   1.3.0   stable
PEAR             1.9.4   stable
Structures_Graph 1.0.4   stable
XML_Util         1.2.1   stable
17
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
16