tags:

views:

25

answers:

2

I'm trying to use php to get the list of loaded apache modules using apache_get_modules(), but I get an error that this function is undefined.

From searching it seems the problem is that

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

I'm not sure if this is the case, but I'm on shared hosting. Any ideas how to find out the list of loaded apache modules, preferably with php, but I'm open to suggestions.

+1  A: 
  • phpinfo() will tell you how PHP is installed, especially the Server API row.
  • You could parse the config files for Apache to find out which modules are configured.
  • You could run something like apache2 -t -D DUMP_MODULES to obtain a list of modules.
Sjoerd
Checked phpinfo and it turned out to be installed as CGI. Do you mind giving some more detail on how to get one of the last 2 points working. I'm on shared hosting, so don't have root access.
devling
A: 

Ask the server admin. Otherwise what you do might get logged somewhere...

Quamis