php: add default php.ini

This commit is contained in:
Eric Sagnes 2016-04-29 15:26:20 +09:00
parent 44acb6833b
commit a8bc5b67f8
4 changed files with 20 additions and 10 deletions

View File

@ -123,6 +123,7 @@ with lib;
(mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ])
(mkRemovedOptionModule [ "services" "printing" "cupsdConf" ])
(mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ])
(mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ])
];
}

View File

@ -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
'';

View File

@ -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;
};
};

View File

@ -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 {