最近インストールしたバージョンの MAMP に、mysql 拡張機能と mod_mcrypt、mod_mbstring、および openssl がインストールされているかどうかを確認しようとしています。私はphpmyinfoの下を見て、configureコマンドセクションを見てください。たとえば、「./configure」「--with-mysql=/Applications/MAMP/Library」これを端末に入力するだけの問題ですか、それとも他に何かする必要があります..
2 に答える
次のものだけを含む php ページを作成する場合:
<?php phpinfo(); ?>
次に、さまざまなモジュールが有効になっているかどうかを確認できる出力を表示します。mcrypt が有効になっている場合は、そのセクションが表示され、mbstring についても同じことが表示されます。
以下は私のインストールからの出力です(フォーマットの損失について申し訳ありません)
暗号化
mcrypt サポートが有効になっている
バージョン 2.5.7
API番号20021217
サポートされている暗号 cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
サポートされているモード cbc cfb ctr ecb ncfb nofb ofb stream
ディレクティブ ローカル値 マスター値
mcrypt.algorithms_dir 値なし 値なし
mcrypt.modes_dir 値なし 値なし
Those are simply command line options passed to the C compiler when building PHP. Most extensions do not define such options.
The simplest way is to just have a look at the rest of phpinfo()
's output (possibly using your browser's "Search" feature). Many extensions add their own table there. Additionally, some extensions (not all!) provide version info you can retrieve with phpversion(), e.g.:
var_dump( phpversion('mysqli') );
// 0.1
But the most generalizable and IMHO reliable method is just testing whether the features provided by the extension are available for you. You can use function_exists() and class_exists():
echo 'Mcrypt: ' . (function_exists('mcrypt_encrypt') ? 'Available' : 'Not available');