Show Apache's Loaded Modules

This little extract was posted on the original skiffie.com and had some positive feedback – we print out the Apache modules that are running on the server. Straightforward, but can be quite a useful little function if you need to know your servers capabilities.

<pre>
<?php
print_r
(apache_get_modules());
?>
</pre>

Notes from previous comments:

This only works when PHP is installed as an Apache module. This will not function when using PHP as CGI (ex: suPHP).

Without PHP from the shell:

apache2 -t -D DUMP_MODULES

For apache 2.2.x
httpd (or apache.exe) -M will show static and shared modules loaded via LoadModule.
httpd -l will show only static (compiled in) modules

For apache 2.0.x
httpd (apache.exe) -l is available but -M is not.
You will need to manually check the LoadModule directives and the files.

In this snippet we print out the Apache modules that are running on the server.

Share and Enjoy:

  • Digg
  • FriendFeed
  • BlinkList
  • Twitter
  • del.icio.us
  • Facebook
  • Ping.fm
  • StumbleUpon
  • Google Bookmarks

You must be logged in to post a comment.

Recommended