On php-fastcgi it is not possible to use php_admin_flag and php_admin_value directives in .htaccess files on a per-directory basis. This can be achieved with htscanner extension.
htscanner errors in apache logs,
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613//htscanner.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613//htscanner.so: cannot open shared object file: No such file or directory in Unknown on line 0
This can be fixed following the below steps,
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 = "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.
<IfModule mod_php5.c>
php_value register_globals Off
</IfModule>or
You can avoid adding ifmodule tag in .htaccess by enable htscanner module for apache,
Go to the below location to download "mod_htscanner2.c"
=-=-
cd /usr/local/src
wget http://code.ohloh.net/file?fid=9ljNO4gqaTCyj2VMewqjWbT3J4M&cid={cid!?html}&dl
-==-
Make sure apache has mod_so
/usr/local/apache/bin/httpd -l | grep mod_so.c mod_so.c
Compile the module using command,
-==-
/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
You will get the output as,
-=-=
LoadModule htscanner_module modules/mod_htscanner2.so
=-=-
For PHP-5.3, download the htscanner from the below link, URL :
URL : https://github.com/piannelli/htscanner-enhanced/archive/master.zip
wget https://github.com/piannelli/htscanner-enhanced/archive/master.zip
unzip master.zip
cd htscanner-enhanced
phpize
./configure –enable-htscanner –with-php-config=/usr/bin/php-config
make
make install
Add in php.ini
[htscanner]
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.
<IfModule mod_php5.c>
php_value register_globals Off
</IfModule>or
You can avoid adding ifmodule tag in .htaccess by enable htscanner module for apache,
Go to the below location to download "mod_htscanner2.c"
=-=-
cd /usr/local/src
wget http://code.ohloh.net/file?fid=9ljNO4gqaTCyj2VMewqjWbT3J4M&cid={cid!?html}&dl
-==-
Make sure apache has mod_so
/usr/local/apache/bin/httpd -l | grep mod_so.c mod_so.c
Compile the module using command,
-==-
/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
You will get the output as,
-=-=
LoadModule htscanner_module modules/mod_htscanner2.so
=-=-
Extract, and folow the above steps.
Done
htscanner errors in apache logs,
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613//htscanner.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613//htscanner.so: cannot open shared object file: No such file or directory in Unknown on line 0
This can be fixed following the below steps,
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 = "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.
<IfModule mod_php5.c>
php_value register_globals Off
</IfModule>or
You can avoid adding ifmodule tag in .htaccess by enable htscanner module for apache,
Go to the below location to download "mod_htscanner2.c"
=-=-
cd /usr/local/src
wget http://code.ohloh.net/file?fid=9ljNO4gqaTCyj2VMewqjWbT3J4M&cid={cid!?html}&dl
-==-
Make sure apache has mod_so
/usr/local/apache/bin/httpd -l | grep mod_so.c mod_so.c
Compile the module using command,
-==-
/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
You will get the output as,
-=-=
LoadModule htscanner_module modules/mod_htscanner2.so
=-=-
For PHP-5.3, download the htscanner from the below link, URL :
URL : https://github.com/piannelli/htscanner-enhanced/archive/master.zip
wget https://github.com/piannelli/htscanner-enhanced/archive/master.zip
unzip master.zip
cd htscanner-enhanced
phpize
./configure –enable-htscanner –with-php-config=/usr/bin/php-config
make
make install
Add in php.ini
[htscanner]
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.
<IfModule mod_php5.c>
php_value register_globals Off
</IfModule>or
You can avoid adding ifmodule tag in .htaccess by enable htscanner module for apache,
Go to the below location to download "mod_htscanner2.c"
=-=-
cd /usr/local/src
wget http://code.ohloh.net/file?fid=9ljNO4gqaTCyj2VMewqjWbT3J4M&cid={cid!?html}&dl
-==-
Make sure apache has mod_so
/usr/local/apache/bin/httpd -l | grep mod_so.c mod_so.c
Compile the module using command,
-==-
/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
You will get the output as,
-=-=
LoadModule htscanner_module modules/mod_htscanner2.so
=-=-
Extract, and folow the above steps.
Done