summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@users.noreply.github.com>2016-05-05 19:16:04 +0200
committerJoachim Fasting <joachifm@users.noreply.github.com>2016-05-05 19:16:04 +0200
commit23fd70b71951b7b1446d7803e714bf55a291d694 (patch)
treefa11bf9f1377ebc0e3497831eb2def15e387ae7b
parentebba6571fe252cc7df99c78891860cf1d1dd0955 (diff)
parenta8bc5b67f8caf82585932eab14cb99fcbc4d595b (diff)
downloadnixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar.gz
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar.bz2
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar.lz
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar.xz
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.tar.zst
nixpkgs-23fd70b71951b7b1446d7803e714bf55a291d694.zip
Merge pull request #15018 from ericsagnes/pkg-fix/php
php: add default php.ini
-rw-r--r--nixos/modules/rename.nix1
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/default.nix2
-rw-r--r--nixos/modules/services/web-servers/phpfpm.nix21
-rw-r--r--pkgs/development/interpreters/php/default.nix6
4 files changed, 20 insertions, 10 deletions
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index 6b02446d53b..5c4793624e0 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -123,6 +123,7 @@ with lib;
     (mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ])
     (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ])
     (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ])
+    (mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ])
 
   ];
 }
diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix
index 7953729c00c..c23897192b4 100644
--- a/nixos/modules/services/web-servers/apache-httpd/default.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/default.nix
@@ -406,7 +406,7 @@ let
         ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
     }
     ''
-      cat ${php}/etc/php-recommended.ini > $out
+      cat ${php}/etc/php.ini > $out
       echo "$options" >> $out
     '';
 
diff --git a/nixos/modules/services/web-servers/phpfpm.nix b/nixos/modules/services/web-servers/phpfpm.nix
index 6a60000ce19..2658d7117e3 100644
--- a/nixos/modules/services/web-servers/phpfpm.nix
+++ b/nixos/modules/services/web-servers/phpfpm.nix
@@ -19,6 +19,12 @@ let
     ${concatStringsSep "\n" (mapAttrsToList (n: v: "[${n}]\n${v}") cfg.poolConfigs)}
   '';
 
+  phpIni = pkgs.writeText "php.ini" ''
+    ${readFile "${cfg.phpPackage}/etc/php.ini"}
+
+    ${cfg.phpOptions}
+  '';
+
 in {
 
   options = {
@@ -44,10 +50,15 @@ in {
         '';
       };
 
-      phpIni = mkOption {
-        type = types.path;
-        default = "${cfg.phpPackage}/etc/php-recommended.ini";
-        description = "php.ini file to use.";
+      phpOptions = mkOption {
+        type = types.lines;
+        default = "";
+        example =
+          ''
+            date.timezone = "CET"
+          '';
+        description =
+          "Options appended to the PHP configuration file <filename>php.ini</filename>.";
       };
 
       poolConfigs = mkOption {
@@ -84,7 +95,7 @@ in {
         mkdir -p "${stateDir}"
       '';
       serviceConfig = {
-        ExecStart = "${cfg.phpPackage}/sbin/php-fpm -y ${cfgFile} -c ${cfg.phpIni}";
+        ExecStart = "${cfg.phpPackage}/bin/php-fpm -y ${cfgFile} -c ${phpIni}";
         PIDFile = pidFile;
       };
     };
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index d6b4e03a2f6..8c51cd2b3a8 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -265,14 +265,12 @@ let
             --replace '@PHP_LDFLAGS@' ""
         done
 
-        iniFile=$out/etc/php-recommended.ini
         [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
         ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
       '';
 
-      installPhase = ''
-        unset installPhase; installPhase;
-        cp php.ini-production $iniFile
+      postInstall = ''
+        cp php.ini-production $out/etc/php.ini
       '';
 
       src = fetchurl {