I am trying to confirm if I have mysql extension and mod_mcrypt, mod_mbstring as well as openssl installed on my recently installed version of MAMP. I have taken a look under phpmyinfo and see configure command section. For example './configure' '--with-mysql=/Applications/MAMP/Library' Is it just a matter of entering this into terminal or is there anything else I need to do..
-
Scroll down the long list of installed extensions below the configure command. – deceze Mar 04 '13 at 12:04
-
One way to check PHP runtime configuration is to write a small script with just the line ` phpinfo(); ?>` and then look at the generated page. – didierc Mar 04 '13 at 12:11
2 Answers
If you create a php page with just the following in it:
<?php phpinfo(); ?>
And then view the output you can see if the various modules are enabled. If mcrypt is enab;led you will see section for it and the same for mbstring.
The following is output from my installation (sorry about the loss of formatting)
mcrypt
mcrypt support enabled
Version 2.5.7
Api No 20021217
Supported ciphers 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
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream
Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value

- 1,047
- 8
- 19
-
For mbstring I get.. Multibyte Support enabled Multibyte string engine libmbfl HTTP input encoding translation disabled libmbfl version 1.3.2 Does this mean it is enabled? Thanks – NATHAN C Mar 04 '13 at 12:17
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');

- 142,137
- 41
- 261
- 360
-
for mbstring I have multibyte support - enabled. But HTTP input encoding translation - disabled. Does this mean mstring is enabled or disabled? Thanks – NATHAN C Mar 04 '13 at 12:26
-
1@NATHANC PHP does not load disabled extensions. If it shows up in phpinfo(), it's there. But you don't have enabled the [HTTP input encoding translation](http://php.net/manual/en/mbstring.configuration.php) feature. Enable it if you need it. – Álvaro González Mar 04 '13 at 12:33
-
-
@NATHANC - Not clear what your question is. Do you know how to change PHP directives? – Álvaro González Mar 04 '13 at 12:41
-
I just want to know how to enable the HTTP feature like you mentioned, if it is already disabled. Not sure if I will need it but for now I would like to. I am not sure how to change PHP directives. – NATHAN C Mar 04 '13 at 12:47
-
@NATHANC - See if [this helps](http://stackoverflow.com/questions/9343151/where-is-php-ini-in-mac-os-x-lion-thought-it-was-in-usr-local-php5-lib). – Álvaro González Mar 04 '13 at 12:50