If you’re a PHP developer who use Windows for development platform, you might want to try htscanner. It’s a PHP extension that parses configuration files (for example .htaccess) and changes the PHP settings according to it. You can find its windows binaries here.

It’s a very useful extension especially when you need to simulate PHP configuration setting using .htaccess in Windows, which you can’t do this if you’re using PHP in CGI/FastCGI that usually comes in Apache+PHP installation for Windows.

Just download php_htscanner.dll from PECL4Win, save it to your extension directory (for ex: c:\php\ext) and add these lines in your php.ini :


htscanner.default_docroot = c:\apache\htdocs

c:\apache\htdocs is your docroot, change it to your own docroot directory. Then create .htaccess file in your docroot with these lines:

<IfModule mod_php.c>
php_value register_globals off

You need <IfModule mod_php.c> to make sure you won’t get 500 error if you’re using mod_access in your Apache installation, also it’s compatible with Apache+mod_php configuration that usually comes with Apache in Linux. In this example i make register_globals off for all PHP files in c:\apache\htdocs.

Thanks to Pierre for maintaining this extension.

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.