HTTP Auth module uses an URL Rewrite workaround to support CGI-based PHP: http://codex.gallery2.org/Gallery2:Modules:httpauth#Authorization_Header
However, in Apache 2.2, the rewrite rule causes PHP not to work when authorized: https://issues.apache.org/bugzilla/show_bug.cgi?id=40781
As mentioned in the Apache bug, adding NS flag to the rewrite rule fixes the issue. Suggested patch:
--- gallery2.orig/modules/httpauth/module.inc 2010-03-24 16:50:17.362093000 +0200
+++ gallery2/modules/httpauth/module.inc 2010-03-24 17:59:13.532626000 +0200
@@ -300,7 +300,7 @@
'pattern' => '!' . GalleryUtilities::prefixFormVariable(
'authorization') . '=')),
'options' => array('baseUrl' => '%{REQUEST_URI}'),
- 'flags' => array('QSA'),
+ 'flags' => array('QSA', 'NS'),
'keywords' => array(
'authorization' => array(
'pattern' => '(.+)',
Suggested patch