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.

wget http://pecl.php.net/get/htscanner-1.0.0.tgz
tar -zxf htscanner-1.0.0.tgz
cd htscanner-1.0.0
phpize
./configure –enable-htscanner –with-php-config=/usr/bin/php-config
make
make install

Collect the extension_di from the “make install” output.

Add in php.ini

[htscanner]
extension_dir = “/usr/lib/php/extensions/no-debug-non-zts-20060613//”
extension = “htscanner.so”
config_file = “.htaccess”
default_docroot = “/”
default_ttl = 300
stop_on_error = 0

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

or

<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_value memory_limit 64M
</IfModule>

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
   /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
Advertisements
  1. # /usr/local/apache/bin/apxs -c -a -i mod_htscanner2.c
    /usr/local/apache/build/libtool –silent –mode=compile gcc -prefer-pic -m64 -fPIC -DPIC -D_REENTRANT -D_GNU_SOURCE -m64 -fPIC -DPIC -pthread -I/opt/pcre/include -I/usr/local/apache/include -I/usr/local/apache/include -I/usr/local/apache/include -c -o mod_htscanner2.lo mod_htscanner2.c && touch mod_htscanner2.slo
    gcc: mod_htscanner2.c: No such file or directory
    gcc: no input files
    apxs:Error: Command failed with rc=65536

    Any Idea?

  2. Okay.. i got the solution.. I was not in the unzipped location of htscanner 🙂

  3. 🙂

  4. correct syntax for
    ./configure –enable-htscanner –with-php-config=/usr/bin/php-config

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: