3
0
Fork 0
forked from mirrors/nixpkgs

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" "cupsFilesConf" ])
(mkRemovedOptionModule [ "services" "printing" "cupsdConf" ]) (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ])
(mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ]) (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ])
(mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ])
]; ];
} }

View file

@ -406,7 +406,7 @@ let
([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices)); ([ mainCfg.phpOptions ] ++ (map (svc: svc.phpOptions) allSubservices));
} }
'' ''
cat ${php}/etc/php-recommended.ini > $out cat ${php}/etc/php.ini > $out
echo "$options" >> $out echo "$options" >> $out
''; '';

View file

@ -19,6 +19,12 @@ let
${concatStringsSep "\n" (mapAttrsToList (n: v: "[${n}]\n${v}") cfg.poolConfigs)} ${concatStringsSep "\n" (mapAttrsToList (n: v: "[${n}]\n${v}") cfg.poolConfigs)}
''; '';
phpIni = pkgs.writeText "php.ini" ''
${readFile "${cfg.phpPackage}/etc/php.ini"}
${cfg.phpOptions}
'';
in { in {
options = { options = {
@ -44,10 +50,15 @@ in {
''; '';
}; };
phpIni = mkOption { phpOptions = mkOption {
type = types.path; type = types.lines;
default = "${cfg.phpPackage}/etc/php-recommended.ini"; default = "";
description = "php.ini file to use."; example =
''
date.timezone = "CET"
'';
description =
"Options appended to the PHP configuration file <filename>php.ini</filename>.";
}; };
poolConfigs = mkOption { poolConfigs = mkOption {
@ -84,7 +95,7 @@ in {
mkdir -p "${stateDir}" mkdir -p "${stateDir}"
''; '';
serviceConfig = { serviceConfig = {
ExecStart = "${cfg.phpPackage}/sbin/php-fpm -y ${cfgFile} -c ${cfg.phpIni}"; ExecStart = "${cfg.phpPackage}/bin/php-fpm -y ${cfgFile} -c ${phpIni}";
PIDFile = pidFile; PIDFile = pidFile;
}; };
}; };

View file

@ -265,14 +265,12 @@ let
--replace '@PHP_LDFLAGS@' "" --replace '@PHP_LDFLAGS@' ""
done done
iniFile=$out/etc/php-recommended.ini
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
''; '';
installPhase = '' postInstall = ''
unset installPhase; installPhase; cp php.ini-production $out/etc/php.ini
cp php.ini-production $iniFile
''; '';
src = fetchurl { src = fetchurl {