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