For security reasons, I need to check if a directory is not readable by a client, i.e. that the Apache server supports the .htaccess (no AllowOverride None in the apache configuration files). This is very important as I have recently discovered that a LOT of products and framework are not checking this (including Zend and Symphony). Is there a way to check this using only PHP ?
BTW, correct me if I am wrong but it seems that other servers (nginx or lighttpd) do not support .htaccess. In these cases, how can I check that my directory is not readable by a client ?
You could use SetEnvIf in htaccess to set a variable, and then access it from within PHP. That will tell you if htaccess is being used (and the SetEnvIf module is running). But it won’t tell you much more – it won’t tell you if mod_rewrite is available, for example. To tell what modules are running, you could check the output of phpinfo programatically.