PHPのコンパイルオプションの調査

方法1.cat config.nice

コンパイルした(はずの)ディレクトリに移動して「config.nice」ファイルの中身を確認します。
以下、コマンド実行例。

[root]# cat config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-config-file-path=/usr/local/apache2/conf/php' \
'--enable-mbstring' \
'--enable-mbregex' \
'--with-zlib-dir=/usr' \
'--with-pgsql=no' \
'--with-pdo-pgsql=no' \
'--with-pear=no' \
'--with-mysqli=/usr/bin/mysql_config' \
'--with-sqlite=no' \
'--with-pdo-sqlite=no' \
'--with-mcrypt=/usr/local' \
"$@"
ちなみに、config.niceというのは、

中身は #! /bin/sh から始まるシェルスクリプト。前回configure時のオプションが、そのまま実行できる形で残ってます。

config.nice って何? at softelメモ

方法2.php -i | grep './configure'

PHPコマンドのオプション「-i」を使って、phpinfo の実行結果をコマンドライン形式で表示し、その結果から、コンパイルオプションをgrepで抜き出します。
以下、コマンド実行例。見やすくするために改行を入れていますが、実際には1行で表示されます。

[root]# php -i | grep './configure'
Configure Command =>  './configure' 
 '--with-apxs2=/usr/local/apache2/bin/apxs'
 '--with-config-file-path=/usr/local/apache2/conf/php'
 '--enable-mbstring'
 '--enable-mbregex'
 '--with-zlib-dir=/usr'
 '--with-pgsql=no'
 '--with-pdo-pgsql=no'
 '--with-pear=no'
 '--with-mysqli=/usr/bin/mysql_config'
 '--with-sqlite=no'
 '--with-pdo-sqlite=no'
 '--with-mcrypt=/usr/local'
PHPコマンドには以外にいろんなオプションがあるので、利用すると便利です。

知ってるとたまに便利な php コマンドのオプション | バシャログ。