Change:
Describe the bug When I enable PHP in httpd using , the file when visited can only see 11 extensions instead of the 52 I get when I run it through php CLI command. To Reproduce A failing NixOS test: Additional context Likely caused by the great refactor: Notify maintainers
Yep, the refactor relies on a configuration file with all the extensions to load being present and specified. For the binary, we have a wrapper that just tells PHP to look in the right folder for the config, but with the module, it looks like that's not used, since it loads PHP as an extension. The solution would probably be to inherit the config from the package as the first thing put into the it already generates; it should be accessible as .

Discussion:
httpdConf = cfg.configFile; <del> php = cfg.phpPackage.override { apacheHttpd = pkg.dev; /* otherwise it only gets .out */ }; </del> <ins> php = cfg.phpPackage.override { apacheHttpd = pkg; }; </ins> phpMajorVersion = lib.versions.major (lib.getVersion php);

} '' cat ${php}/etc/php.ini > $out <ins> cat ${php}/lib/custom-php.ini > $out </ins> echo "$options" >> $out '';

(onFullSupported "nixos.tests.openssh") (onFullSupported "nixos.tests.pantheon") (onFullSupported "nixos.tests.php.fpm") <ins> (onFullSupported "nixos.tests.php.httpd") </ins> (onFullSupported "nixos.tests.php.pcre") (onFullSupported "nixos.tests.plasma5") (onFullSupported "nixos.tests.predictable-interface-names.predictableNetworkd")

pkgs ? import ../../.. { inherit system config; } }: { fpm = import ./fpm.nix { inherit system pkgs; }; <ins> httpd = import ./httpd.nix { inherit system pkgs; }; </ins> pcre = import ./pcre.nix { inherit system pkgs; }; }

machine.wait_for_unit("phpfpm-foobar.service") # Check so we get an evaluated PHP back <del> assert "PHP Version ${pkgs.php.version}" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") </del> <ins> response = machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "PHP Version ${pkgs.php.version}" in response, "PHP version not detected" </ins> # Check so we have database and some other extensions loaded <del> assert "json" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "opcache" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "pdo_mysql" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "pdo_pgsql" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "pdo_sqlite" in machine.succeed("curl -vvv -s http://127.0.0.1:80/") </del> <ins> for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: assert ext in response, f"Missing {ext} extension" </ins> ''; })

<ins> import ../make-test-python.nix ({pkgs, ...}: { name = "php-httpd-test"; meta.maintainers = with pkgs.stdenv.lib.maintainers; [ etu ]; machine = { config, lib, pkgs, ... }: { services.httpd = { enable = true; adminAddr = "admin@phpfpm"; virtualHosts."phpfpm" = let testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();"; in { documentRoot = "${testdir}/web"; locations."/" = { index = "index.php index.html"; }; }; enablePHP = true; }; }; testScript = { ... }: '' machine.wait_for_unit("httpd.service") # Check so we get an evaluated PHP back response = machine.succeed("curl -vvv -s http://127.0.0.1:80/") assert "PHP Version ${pkgs.php.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" ''; }) </ins>

'' machine.wait_for_unit("httpd.service") # Ensure php evaluation by matching on the var_dump syntax <del> assert 'string(${toString (builtins.stringLength testString)}) "${testString}"' in machine.succeed( "curl -vvv -s http://127.0.0.1:80/index.php" ) </del> <ins> response = machine.succeed("curl -vvv -s http://127.0.0.1:80/index.php") expected = 'string(${toString (builtins.stringLength testString)}) "${testString}"' assert expected in response, "Does not appear to be able to use subgroups." </ins> ''; })