forked from mirrors/nixpkgs
php: add default php.ini
This commit is contained in:
parent
44acb6833b
commit
a8bc5b67f8
|
@ -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" ])
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue