From d0c9a3ce3211a53f61bb22092784ea066b3aa308 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 6 Jul 2012 23:28:46 +0200 Subject: [PATCH] Apache: build PHP against the right httpd If httpd is built with a threaded MPM, then PHP needs to be built with thread support as well. --- modules/services/web-servers/apache-httpd/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 828b2bc4c1f..04418d97b10 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -8,6 +8,8 @@ let httpd = pkgs.apacheHttpd.override { mpm = mainCfg.multiProcessingModule; }; + php = pkgs.php.override { apacheHttpd = httpd; }; + getPort = cfg: if cfg.port != 0 then cfg.port else if cfg.enableSSL then 443 else 80; extraModules = attrByPath ["extraModules"] [] mainCfg; @@ -308,7 +310,7 @@ let allModules = concatMap (svc: svc.extraModulesPre) allSubservices ++ map (name: {inherit name; path = "${httpd}/modules/mod_${name}.so";}) apacheModules - ++ optional enablePHP { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; } + ++ optional enablePHP { name = "php5"; path = "${php}/modules/libphp5.so"; } ++ concatMap (svc: svc.extraModules) allSubservices ++ extraForeignModules; in concatMapStrings load allModules @@ -379,7 +381,7 @@ let ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); } '' - cat ${pkgs.php}/etc/php-recommended.ini > $out + cat ${php}/etc/php-recommended.ini > $out echo "$options" >> $out ''; @@ -410,7 +412,7 @@ in extraModules = mkOption { default = []; - example = [ "proxy_connect" { name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; } ]; + example = [ "proxy_connect" { name = "php5"; path = "${php}/modules/libphp5.so"; } ]; description = '' Specifies additional Apache modules. These can be specified as a string in the case of modules distributed with Apache,