htscanner ========= Description ----------- When using a cgi version of php (plain old cgi or fast-cgi) apache can't pass any php settings from htaccess files it parses. This can be solved by giving each user it's own php.ini file, but I didn't like that solution. This extension parses these configuration files (in most cases .htaccess) and changes the settings. It will search all directories for a configuration file from the docroot until the directory where the request scripts is 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 using a diffirent file for php or by putting: <IfModule mod_php.c> php_value foo bart </IfModule> around the settings. This way apache will ignore them. If for some reasons you like to allow your users to have .htaccess files without <IfModule mod_php.c>, you can use the patch below, provided by Eugeny Zadevalov <eugeny at zadevalov dot com>, against apache 2.0.59. === diff -uNr httpd-2.0.59/server/core.c httpd-2.0.59/server/core.c --- httpd-2.0.59/server/core.c 2006-07-12 07:40:55.000000000 +0000 +++ httpd-2.0.59/server/core.c 2006-12-20 16:54:16.000000000 +0000 @@ -1638,6 +1638,11 @@ "> directive missing closing '>'", NULL); } +static const char *php_dummy_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) +{ + return NULL; +} + static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) { const char *errmsg; @@ -3155,6 +3160,10 @@ static const command_rec core_cmds[] = { +/* Dummy php_* commands */ +AP_INIT_TAKE2("php_value", php_dummy_handler, NULL, OR_OPTIONS, "Dummy PHP Value Modifier"), +AP_INIT_TAKE2("php_flag", php_dummy_handler, NULL, OR_OPTIONS, "Dummy PHP Flag Modifier"), + /* Old access config file commands */ AP_INIT_RAW_ARGS("<Directory", dirsection, NULL, RSRC_CONF, === TODO: - add configure option to disable all init error messages (useful if one uses one php.ini for both cli and cgi, having htscanner loaded in CLI) - complete/define the needs for a php4 patch (assigned to Eugeny Zadevalov) Changelog: ---------- 0.5.0 and later changelog is visible in the package.xml or on http://pecl.php.net/htscanner Version 0.4 08-11-2005 - Some setting weren't interpreted correctly Version 0.3 06-11-2005 - Added debug code (set env PHP_HTSCANNER_DEBUG) - Fixed bug with some paths - Some code cleanups Version 0.2 05-11-2005 - Parser can handle tabs and whitespaces in a directive Version 0.1 02-10-2005 - First release Install ------- Make sure you have the development package installed if you installed php from a binary package. * Run phpize in the htaccess directory. Use the phpize script from the php version you wish to compile htscanner for. * run the configure script the phpize create with --enable-htscanner * run make * now install the created module by copying the modules/htscanner.so file to the php extension directory. or use make install * copy the htscanner.ini configuration file to the php conf.d directory. If you're php version doesn't support that (eg on Suse) then you can add the settings from htscanner.ini to you're php.ini For questions or request mail me: Pierre-A. Joye <pierre@php.net>