read apache settings

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
is it possible from a php script to read the apache settings ?
for example

ciao, Massimo

Re: read apache settings

Quoted text here. Click to load it

Try this it allows you to set the things of php.ini file


may possible to read http.conf file too


Re: read apache settings

massimo.sala escribió:
Quoted text here. Click to load it

As far as I know there's not direct way.

Depending in the security settings, you might be able to parse the
output of several sources:

- The *.conf files themselves (you'd need to follow the included files
- The /server-info page generated by mod_info
- The output of the "httpd -S" command (which is fairly incomplete)

The second possibility looks quite promising:


But, of course, this Apache module is not something you're allowed to
enable in a shared hosting.

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor al baño María:

Re: read apache settings

Quoted text here. Click to load it

There is no direct function in PHP to read apache configuration. You
could try to open the conf-file and look for the options manually.

You could also make other checks. For instance, if you want to know if
a certain directory has an open index, you could perform an HTTP
request to that directory. If that request returns 403, the index is
not allowed...

Kind regards,

Site Timeline