Php/docs/install.pecl.static

提供:Dev Guides
< Php
移動先:案内検索

PECL 拡張モジュールを PHP に静的に組み込む

PECL 拡張モジュールを PHP に静的に組み込みたいと思うこともあるでしょう。 そのためには、拡張モジュールのソースを /your/phpsrcdir/ext/ ディレクトリに置き、PHP にその設定スクリプトを生成させる必要があります。

$ cd /your/phpsrcdir/ext
$ pecl download extname
$ gzip -d < extname.tgz | tar -xvf -
$ mv extname-x.x.x extname

上記を行うと、以下のディレクトリが作成されます。

/your/phpsrcdir/ext/extname

これ以降、PHP に configure スクリプトを再実行させ、通常通りに PHP をビルドします。

$ cd /your/phpsrcdir $ rm configure $ ./buildconf --force $ ./configure --help $ ./configure --with-extname --enable-someotherext --with-foobar $ make $ make install

注意:

'buildconf' スクリプトを実行するためには、autoconf 2.13 と automake 1.4+ が必要です (新しいバージョンの autoconf では動作するかも知れませんが、 サポートされていません)。

拡張モジュールによって、--enable-extname もしくは --with-extname オプションを指定します。 外部ライブラリを使用しない拡張モジュールについては、 --enable が使われるのが一般的です。 buildconf の後で、以下を行うと確認できます。

$ ./configure --help | grep extname