unit: drop php81 support

This commit is contained in:
Maximilian Bosch
2025-10-03 23:46:46 +02:00
parent 4085aba10a
commit 2241dbad8a
2 changed files with 7 additions and 12 deletions

View File

@@ -18,15 +18,15 @@ in
services.unit = {
enable = true;
config = pkgs.lib.strings.toJSON {
listeners."*:9081".application = "php_81";
applications.php_81 = {
type = "php 8.1";
listeners."*:9081".application = "php_82";
applications.php_82 = {
type = "php 8.2";
processes = 1;
user = "testuser";
group = "testgroup";
root = "${testdir}/www";
index = "info.php";
options.file = "${pkgs.unit.usedPhp81}/lib/php.ini";
options.file = "${pkgs.unit.usedPhp82}/lib/php.ini";
};
};
};
@@ -49,7 +49,7 @@ in
# Check so we get an evaluated PHP back
response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9081/")
assert "PHP Version ${pkgs.unit.usedPhp81.version}" in response, "PHP version not detected"
assert "PHP Version ${pkgs.unit.usedPhp82.version}" in response, "PHP version not detected"
# Check so we have database and some other extensions loaded
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:

View File

@@ -8,9 +8,7 @@
withPython3 ? true,
python3,
ncurses,
withPHP81 ? true,
php81,
withPHP82 ? false,
withPHP82 ? true,
php82,
withPerl ? true,
perl,
@@ -34,7 +32,6 @@ let
fpmSupport = false;
};
php81-unit = php81.override phpConfig;
php82-unit = php82.override phpConfig;
inherit (lib) optional optionals optionalString;
@@ -59,7 +56,6 @@ stdenv.mkDerivation rec {
python3
ncurses
]
++ optional withPHP81 php81-unit
++ optional withPHP82 php82-unit
++ optional withPerl perl
++ optional withRuby_3_1 ruby_3_1
@@ -77,11 +73,10 @@ stdenv.mkDerivation rec {
++ optional withDebug "--debug";
# Optionally add the PHP derivations used so they can be addressed in the configs
usedPhp81 = optionals withPHP81 php81-unit;
usedPhp82 = optionals withPHP82 php82-unit;
postConfigure = ''
${optionalString withPython3 "./configure python --module=python3 --config=python3-config --lib-path=${python3}/lib"}
${optionalString withPHP81 "./configure php --module=php81 --config=${php81-unit.unwrapped.dev}/bin/php-config --lib-path=${php81-unit}/lib"}
${optionalString withPHP82 "./configure php --module=php82 --config=${php82-unit.unwrapped.dev}/bin/php-config --lib-path=${php82-unit}/lib"}
${optionalString withPerl "./configure perl --module=perl --perl=${perl}/bin/perl"}
${optionalString withRuby_3_1 "./configure ruby --module=ruby31 --ruby=${ruby_3_1}/bin/ruby"}