понедельник, 5 апреля 2010 г.

.htaccess php_flag with fastcgi on debian

apt-get source apache2
cd apache2-2.2.9/
vi dummy_php_options.patch


--- 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("


patch -p1 < dummy_php_options.patch

fakeroot debian/rules binary

dpkg -i ../apache...


wget http://pecl.php.net/get/htscanner-0.9.0.tgz
tar -xzf htscanner-0.9.0.tgz
cd htscanner-0.9.0
phpize
./configure

need php_flag patch
vi htscanner.c
search static int value_hnd
and change
//if (!strcasecmp(value, "On") || (value[0] == '1' && value[1] == '\0')) {
if (((value[0] == 'O' || value[0] == 'o' ) && value[1] == 'n' ) || (value[0] == '1')) {

make
make install

vi /etc/php5/conf.d/htscanner.ini
[htscanner]
extension="htscanner.so"
config_file=".htaccess"
default_docroot=/
default_ttl=300
stop_on_error = 0

Комментариев нет:

Отправить комментарий