467,146 Members | 1,305 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

Displaying a list of all modules (extensions) installed

DQ
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.

Mar 29 '06 #1
  • viewed: 24890
Share:
4 Replies
NC
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

Mar 29 '06 #2

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.


See http://fi.php.net/get-loaded-extensions/.

Mar 29 '06 #3
DQ
You're right! I couldn't see the forest for the trees. I was looking
for a list of key-value pairs. I didn't realize that the _headings_
were what I needed. Thanks.

Mar 29 '06 #4
DQ
Perfect! That's just what I needed.

Mar 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Matthew Wilson | last post: by
reply views Thread by Matthias | last post: by
2 posts views Thread by . | last post: by
reply views Thread by John [H2O] | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.