2 testString = "can-use-subgroups";
4 import ../make-test-python.nix ({ pkgs, lib, php, ... }: {
5 name = "php-${php.version}-httpd-pcre-jit-test";
6 meta.maintainers = lib.teams.php.members;
8 nodes.machine = { lib, pkgs, ... }: {
12 adminAddr = "please@dont.contact";
15 phpOptions = "pcre.jit = true";
18 testRoot = pkgs.writeText "index.php"
21 preg_match('/(${testString})/', '${testString}', $result);
28 <Directory ${testRoot}>
35 # PCRE JIT SEAlloc feature does not play well with fork()
36 # The feature needs to either be disabled or PHP configured correctly
37 # More information in https://bugs.php.net/bug.php?id=78927 and https://bugs.php.net/bug.php?id=78630
38 pcreJitSeallocForkIssue = pkgs.writeText "pcre-jit-sealloc-issue.php" ''
40 preg_match('/nixos/', 'nixos');
45 machine.wait_for_unit("httpd.service")
46 # Ensure php evaluation by matching on the var_dump syntax
47 response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/index.php")
48 expected = 'string(${toString (builtins.stringLength testString)}) "${testString}"'
49 assert expected in response, "Does not appear to be able to use subgroups."
50 machine.succeed("${php}/bin/php -f ${pcreJitSeallocForkIssue}")