summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2018-05-18 18:36:39 +0200
committerAnatol Belski <ab@php.net>2018-05-18 18:36:39 +0200
commit6043a2d6f74bf5125573fde198070ac9804d5e6e (patch)
treeadc18e4b3f809112c0eff07eb346c9bce5dc20df
parent33382dc7eef4714d6dc5fd2ed6db97bdba999e54 (diff)
downloadphp-git-6043a2d6f74bf5125573fde198070ac9804d5e6e.tar.gz
Fix Opcache test fails regarding to AppVeyor image update
-rw-r--r--ext/opcache/tests/php_cli_server.inc18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/opcache/tests/php_cli_server.inc b/ext/opcache/tests/php_cli_server.inc
index 456ed663b8..ca781b7cd7 100644
--- a/ext/opcache/tests/php_cli_server.inc
+++ b/ext/opcache/tests/php_cli_server.inc
@@ -7,16 +7,22 @@ function php_cli_server_start($ini = "") {
$php_executable = getenv('TEST_PHP_EXECUTABLE');
$doc_root = __DIR__;
- $descriptorspec = array(
- 0 => STDIN,
- 1 => STDOUT,
- 2 => STDERR,
- );
-
if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $descriptorspec = array(
+ 0 => STDIN,
+ 1 => STDOUT,
+ 2 => array("pipe", "w"),
+ );
+
$cmd = "{$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS;
$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true));
} else {
+ $descriptorspec = array(
+ 0 => STDIN,
+ 1 => STDOUT,
+ 2 => STDERR,
+ );
+
$cmd = "exec {$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS . " 2>/dev/null";
$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
}