apache: fastcgi config core, implement php5-cgi fastcgi
[hcoop/domtool2.git] / src / plugins / apache.sml
index b7d36a4..c4b47af 100644 (file)
@@ -467,7 +467,8 @@ fun vhostPost () = (!post ();
                    app (TextIO.closeOut o #2) (!vhostFiles))
 
 val php_version = fn (EVar "php5", _) => SOME 5
-                  | _ => NONE
+                   | (EVar "fast_php", _) => SOME 6
+                   | _ => NONE
 
 fun vhostBody (env, makeFullHost) =
     let
@@ -551,14 +552,23 @@ fun vhostBody (env, makeFullHost) =
                                  TextIO.output (file, user);
                                  TextIO.output (file, "/DAVLock");
 
-                                 if php <> Config.Apache.defaultPhpVersion then
+                                 if php = Config.Apache.defaultPhpVersion
+                                 then
+                                     ()
+                                 else if php = 6
+                                 then
+                                     (* fastcgi php 5.6 since 6 doesn't exist *)
+                                     (TextIO.output (file, "\n\tAddHandler fcgid-script .php .phtml");
+                                      TextIO.output (file, "\n\tFcgidWrapper \"");
+                                      TextIO.output (file, Config.Apache.fastCgiWrapperOf user);
+                                      TextIO.output (file, " ");
+                                      TextIO.output (file, Config.Apache.phpFastCgiWrapper);
+                                      TextIO.output (file, "\""))
+                                 else
                                      (TextIO.output (file, "\n\tAddHandler x-httpd-php");
                                       TextIO.output (file, Int.toString php);
-                                      TextIO.output (file, " .php .phtml"))
-                                 else
-                                     ();
-
-                                 (ld, file)
+                                      TextIO.output (file, " .php .phtml"));
+                         (ld, file)
                              end)
                          places;
        write "\n\tDocumentRoot ";