Htscanner: Useful forenablingphpdirectivevalues in.htaccessinasuph.p/cgihandlerThatmeans, it allows to use htaccess-like file to configure PHPinasuphp/CGI environment.

Whenusingacgiversionofphp,apachecan’t passanyphpsettingsfromhtaccessfiles it parses. This can be solved by giving each user its own php.ini file, but It’s not a good solution.


This extension parses these configuration files (in most  access) and changes the settings. It will search all directories for a configuration file from the docrootuntilthedirectory where the request script sis found.

Note: When you don’t load the mod_php module in apache, apache will give a 500 error when it finds an htaccess file with a php_* directive. You can prevent this by usingadiffirentfileforphporby putting:




aroundthesettings. Thiswayapachewillignore them.

If for some reasons you like to allow your users to have.htaccessfiles without <IfModule mod_php5.c>,you can use the mod_htscanner.c (Apache 1.x) or mod_htscanner2.c (Apache 2.x) module provided with the package.

The latest htscannersoucecodeis available on  web site



tar -zxf htscanner-1.0.1.tgz






Collect the extension_di from the “make install” output.

Add in php.ini


extension= ""

config_file = “.htaccess”

default_docroot = “/”

default_ttl = 300

stop_on_error = 0

If you are using /usr/local/bin/php-config for –with-php-config thenitwillalwayscomestothe default path(easy apache), so you don’t have to give extension_dir

Add the following lineina.htaccessand see if itworksinaphpinfopage. Keep “Off” or “On” as needed.

php_value register_globals Off

You can avoid adding ifmoduletagin.htaccessbyeenablehtscannermodule for apache

Go to the unzipped package location

Make sure apache has mod_so

/usr/local/apache/bin/httpd -l | grep mod_so.c


Compile the module by



/usr/local/apache/bin/apxs -c -a -imod_htscanner2.c

Restart apache

/usr/local/apache/bin/apachectl configtest

/usr/local/apache/bin/apachectl restart

/usr/local/cpanel/bin/apache_conf_distiller –update /usr/local/apache/conf/httpd.conf

LoadModule htscanner_module modules/