Friday, March 1, 2013

Htscanner Install for enabling php value in .htaccess in suphp/cgi


Allow to use htaccess-like file to configure PHP in a suphp/CGI environment.

cd /usr/src
download htscanner-1.0.1.tgz
tar -zxf htscanner-1.0.1.tgz
cd htscanner-1.0.1
phpize
./configure --enable-htscanner --with-php-config=/usr/local/bin/php-config
make
make install

Collect the extension_di from the "make install" output.

Add in php.ini

[htscanner]
extension = "htscanner.so"
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 then it will always comes to the default path( easyapache), so you don't have to give extension_dir

Add the following line in a .htaccess and see if it works in a phpinfo page. Keep "Off" or "On" as needed.

php_value register_globals Off


You can avoid adding ifmodule tag in .htaccess by enable htscanner module for apache
Go to the unzipped package location
Make sure apache has mod_so

/usr/local/apache/bin/httpd -l | grep mod_so.c
mod_so.c
Compile the module by
cd /usr/local/src

download mod_htscanner2.c
/usr/local/apache/bin/apxs -c -a -i mod_htscanner2.c
Restart apache
/usr/local/apache/bin/apachectl configtest
/usr/local/apache/bin/apachectl restart
/usr/local/cpanel/bin/apache_conf_distiller --update
grep mod_htscanner2.so /usr/local/apache/conf/httpd.conf
LoadModule htscanner_module modules/mod_htscanner2.so

No comments:

Post a Comment