|
Posted by NC on 03/29/06 20:27
DQ wrote:
>
> I just signed up for a web hosting service. They have PHP, but can't
> tell me which modules (extensions) are installed.
>
> Is there a function, or some other easy way, to show all modules
> (extensions) that are installed? phpinfo() doesn't do this.
But of course it does! First, it shows you system information
(including configuration string), then, there's Configuration heading.
First table under Configuration is "PHP Core", the rest of the tables
contain data about extensions and their configuration. Something like
this:
bcmath
BCMath support enabled
calendar
Calendar support enabled
ctype
ctype functions enabled
curl
CURL support enabled
CURL Information libcurl/7.12.0 OpenSSL/0.9.6g zlib/1.1.3
Additionally, you can always check if an extension is present by
testing if functions defined in this extension are available. Example:
if (function_exists('imap_open')) {
echo "IMAP functions are available";
} else {
echo "IMAP functions are not available";
}
You could also call get_defined_functions() and see what extensions are
enabled from the list of functions that are available.
Cheers,
NC
Navigation:
[Reply to this message]
|