unit: add php 8.1
This commit is contained in:
@@ -10,15 +10,15 @@ in {
|
||||
services.unit = {
|
||||
enable = true;
|
||||
config = pkgs.lib.strings.toJSON {
|
||||
listeners."*:9080".application = "php_80";
|
||||
applications.php_80 = {
|
||||
type = "php 8.0";
|
||||
listeners."*:9081".application = "php_81";
|
||||
applications.php_81 = {
|
||||
type = "php 8.1";
|
||||
processes = 1;
|
||||
user = "testuser";
|
||||
group = "testgroup";
|
||||
root = "${testdir}/www";
|
||||
index = "info.php";
|
||||
options.file = "${pkgs.unit.usedPhp80}/lib/php.ini";
|
||||
options.file = "${pkgs.unit.usedPhp81}/lib/php.ini";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -34,14 +34,19 @@ in {
|
||||
};
|
||||
};
|
||||
testScript = ''
|
||||
machine.start()
|
||||
|
||||
machine.wait_for_unit("unit.service")
|
||||
machine.wait_for_open_port(9081)
|
||||
|
||||
# Check so we get an evaluated PHP back
|
||||
response = machine.succeed("curl -f -vvv -s http://127.0.0.1:9080/")
|
||||
assert "PHP Version ${pkgs.unit.usedPhp80.version}" in response, "PHP version not detected"
|
||||
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"
|
||||
|
||||
# Check so we have database and some other extensions loaded
|
||||
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
|
||||
assert ext in response, f"Missing {ext} extension"
|
||||
|
||||
machine.shutdown()
|
||||
'';
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user