Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
php: Fix php pcre by using external lib
Merge pull request #31526 from srhb/fix-php-external-pcre Since #30963 (bbb6ca7 on release-17.09) regex subgroup matches in mod_php were returning incorrect results due to symbol conflicts between system pcre used by Apache and pcre build into php. (cherry picked from commit b62ad4f)
- Loading branch information
Showing
5 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ in rec { | |
nat | ||
nfs3 | ||
openssh | ||
php-pcre | ||
proxy | ||
simple; | ||
installer = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
let testString = "can-use-subgroups"; in | ||
|
||
import ./make-test.nix ({ pkgs, ...}: { | ||
name = "php-httpd-pcre-jit-test"; | ||
machine = { config, lib, pkgs, ... }: { | ||
time.timeZone = "UTC"; | ||
services.httpd = { | ||
enable = true; | ||
adminAddr = "please@dont.contact"; | ||
extraSubservices = lib.singleton { | ||
function = f: { | ||
enablePHP = true; | ||
phpOptions = "pcre.jit = true"; | ||
|
||
extraConfig = | ||
let | ||
testRoot = pkgs.writeText "index.php" | ||
'' | ||
<?php | ||
preg_match('/(${testString})/', '${testString}', $result); | ||
var_dump($result); | ||
?> | ||
''; | ||
in | ||
'' | ||
Alias / ${testRoot}/ | ||
<Directory ${testRoot}> | ||
Require all granted | ||
</Directory> | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
testScript = { nodes, ... }: | ||
'' | ||
$machine->waitForUnit('httpd.service'); | ||
# Ensure php evaluation by matching on the var_dump syntax | ||
$machine->succeed('curl -vvv -s http://127.0.0.1:80/index.php \ | ||
| grep "string(${toString (builtins.stringLength testString)}) \"${testString}\""'); | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters