PDA

View Full Version : htscanner / mod_rewrite in .htaccess



Marcin
07-25-2007, 06:08 AM
Hello everyone,

Is it just me or new installations of custombuild in suphp mode have the following problems?

1. mod_rewrite directives are plain ignored (that in spite of the same directives working fine in Custom HTTPD Configurations, that is, when they are located within vhost definition).

2. htscanner simply DOESN'T WORK.

During testing suphp builds we have encountered one nasty problem: .htaccess files cannot be used with suphp.

This obviously prevents much of software that needs setting peculiar php_flag* values or uses rewrite engine in .htaccess files from working.

Now, this problem can be worked around by using php extension called "htscanner", http://pecl.php.net/package/htscanner .

However, we have found for reasons have been unable to trace so far, htscanner simply doesn't work in httpd/php compilations as ran by ./build script in custombuild.

We have tried it on several hosts, including combinations such as:

- Apache 2.2 / PHP5 (suphp/fastcgi of course)
- Apache 2.0 / PHP4

It just doesn't work: either it produces 500 error, or it ignores settings if configured according to docs:

da8 (87.204.147.158) /home/da8/domains/da8.promo.pl/public_html % cat .htaccess
# <IfModule mod_suphp.c>
<IfModule mod_php.c>
php_flag allow_url_fopen off
php_flag register_globals on
php_admin_flag safe_mode off
php_admin_flag allow_url_include on
php_flag allow_url_include on
</IfModule>

I found that patch for apache 2.0.59 works fine, i.e. after applying the patch and recompiling apache an error is no longer thrown if <IfModule mod..> directives are not present in .htaccess.

However, the php_flag* vars are still completely ignored as if they weren't there at all. When php is compiled in CLI mode they work of course.

Martynas, I would appreciate if you looked at this issue, because inability to use .htaccess is a show-stopper for us, too much software out there is using .htaccess files by default (joomla installers for instance) for us to be able to say to our customers ".htaccess files just don't work here, sorry".

smtalk
07-25-2007, 07:34 AM
Hi,

I'm on a vacation now (till tomorrow), I will take a look at your problem tomorrow too :) Thank you for the suggestions and have a good day!

Marcin
07-30-2007, 03:34 AM
Hi,

I'm on a vacation now (till tomorrow), I will take a look at your problem tomorrow too :) Thank you for the suggestions and have a good day!

Hello,

Any news on that issue?

smtalk
07-30-2007, 03:41 AM
Hi,

I looked at it and it's alpha now :) I think we should wait for beta or RC version, don't you think so?

Marcin
07-30-2007, 03:56 AM
Hi,

I looked at it and it's alpha now :) I think we should wait for beta or RC version, don't you think so?

OK, just curious if the issue is solvable, i.e. if htscanner can be made to work with suphp.

Anyway, it's of high interest to us, so if you need beta testers for this, let us know.

smtalk
07-30-2007, 03:58 AM
I can try to make it work :) But I don't have any test environment right now :)

Marcin
07-30-2007, 04:56 AM
I can try to make it work :) But I don't have any test environment right now :)

Well, we can deliver it. We have one test server set up precisely for that purpose (testing suphp + htscanner). Contact me at admin at domeny dot pl if you want access.

smtalk
08-01-2007, 04:33 PM
Got it working :)

jackc
08-01-2007, 06:37 PM
that's weird, rewrite rules in .htaccess works fine for me on php5+suphp, i use custombuild too.

smtalk
08-02-2007, 02:46 AM
That's not for rewrite rules :) That's for php_value/php_flag entries in .htaccess :)

iceuk626
08-15-2007, 02:37 PM
Got it working :)

So now if php5 and php4 are both installed as fcgi .htaccess will now work?

i.e rewrite rules and admin flags ?

smtalk
08-15-2007, 02:48 PM
Only rewrite rules, for php admin_flags you need to install htscanner.

iceuk626
08-15-2007, 05:27 PM
Fire away.. im sure you know the best way to install it, ive tried but nothing seems to work!

smtalk
11-04-2007, 04:20 AM
Great news for PHP 5.3.0: The new php.ini files parser/scanner + CGI/FastCGI? "htaccess" style ini file (http://pecl.php.net/~jani/patches/new_ini_parser_scanner.patch) support Done