Index: /server/common/patches/httpd-suexec-scripts.patch
===================================================================
--- /server/common/patches/httpd-suexec-scripts.patch	(revision 841)
+++ /server/common/patches/httpd-suexec-scripts.patch	(revision 842)
@@ -47,9 +47,10 @@
 --- httpd-2.2.2/support/suexec.c.old	2006-04-21 21:53:06.000000000 -0400
 +++ httpd-2.2.2/support/suexec.c	2007-05-22 10:32:04.000000000 -0400
-@@ -30,6 +30,8 @@
+@@ -30,6 +30,9 @@
   *
   */
  
 +#define STATIC_CAT_PATH "/usr/local/bin/static-cat"
++#define PHP_PATH "/usr/bin/php-cgi"
 +
  #include "apr.h"
@@ -72,13 +73,5 @@
  
      /* variable name is */
-@@ -140,6 +144,7 @@
-     "UNIQUE_ID=",
-     "USER_NAME=",
-     "TZ=",
-+    "PHPRC=",
-     NULL
- };
- 
-@@ -245,9 +250,58 @@
+@@ -245,9 +250,65 @@
      environ = cleanenv;
  }
@@ -132,4 +125,11 @@
 +}
 +
++static int is_php_extension(const char *file)
++{
++    const char *extension = strrchr(file, '.');
++    if (extension == NULL) return 0;
++    return strcmp(extension + 1, "php") == 0;
++}
++
  int main(int argc, char *argv[])
  {
@@ -259,5 +259,5 @@
          (gid != dir_info.st_gid) ||
          (uid != prg_info.st_uid) ||
-@@ -574,6 +676,7 @@
+@@ -574,12 +676,14 @@
                  prg_info.st_uid, prg_info.st_gid);
          exit(120);
@@ -267,5 +267,13 @@
       * Error out if the program is not executable for the user.
       * Otherwise, she won't find any error in the logs except for
-@@ -606,6 +709,13 @@
+      * "[error] Premature end of script headers: ..."
+      */
+-    if (!(prg_info.st_mode & S_IXUSR)) {
++    if (!is_static_extension(cmd) && !is_php_extension(cmd) &&
++        !(prg_info.st_mode & S_IXUSR)) {
+         log_err("file has no execute permission: (%s/%s)\n", cwd, cmd);
+         exit(121);
+     }
+@@ -606,6 +709,21 @@
        exit(122);
      }
@@ -277,4 +285,12 @@
 +	exit(255);
 +    }
++    if (is_php_extension(cmd)) {
++        setenv("PHPRC", ".", 1);
++        argv[1] = PHP_PATH;
++        argv[2] = "-f";
++        execv(PHP_PATH, &argv[1]);
++	log_err("(%d)%s: php exec failed (%s)\n", errno, strerror(errno), argv[2]);
++	exit(255);
++    }
 +
      /*
Index: /server/fedora/config/etc/httpd/conf/httpd.conf
===================================================================
--- /server/fedora/config/etc/httpd/conf/httpd.conf	(revision 841)
+++ /server/fedora/config/etc/httpd/conf/httpd.conf	(revision 842)
@@ -255,5 +255,4 @@
 
 SetEnv REDIRECT_STATUS CGI
-SetEnv PHPRC .
 
 NameVirtualHost *:80
