diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index fa2f6347d53b..4106fd77f755 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -88,9 +88,12 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache +set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release +if "%THREAD_SAFE%" equ "1" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS + if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit=tracing rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508) -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli -d extension_dir=%PHP_BUILD_DIR% rem prepare for enchant mkdir %~d0\usr\local\lib\enchant-2 @@ -111,9 +114,6 @@ set MIBDIRS=%DEPS_DIR%\share\mibs sed -i "s/exec HexTest .*/exec HexTest cscript\.exe \/nologo %GITHUB_WORKSPACE:\=\/%\/ext\/snmp\/tests\/bigtest\.js/g" %GITHUB_WORKSPACE%\ext\snmp\tests\snmpd.conf start %DEPS_DIR%\bin\snmpd.exe -C -c %GITHUB_WORKSPACE%\ext\snmp\tests\snmpd.conf -Ln -set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release -if "%THREAD_SAFE%" equ "1" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS - rem prepare for mail curl -sLo hMailServer.exe https://www.hmailserver.com/download_file/?downloadid=271 hMailServer.exe /verysilent diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 65027982cf96..59d9606a94ec 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -14,7 +14,9 @@ if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows'); error_reporting(E_ALL); $php = getenv('TEST_PHP_EXECUTABLE_ESCAPED'); -$cmd = $php . ' -r "\$in = file_get_contents(\'php://stdin\'); fwrite(STDOUT, \$in); fwrite(STDERR, \$in);"'; +$args = getenv('TEST_PHP_EXTRA_ARGS'); +$cmd = ' -r "\$in = file_get_contents(\'php://stdin\'); fwrite(STDOUT, \$in); fwrite(STDERR, \$in);"'; +$cmd = join(' ', [$php, $args, $cmd]); $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); $stdin = str_repeat('*', 2049 ); diff --git a/ext/standard/tests/general_functions/proc_open_null.phpt b/ext/standard/tests/general_functions/proc_open_null.phpt index 097d4d2892ed..6c869725dd23 100644 --- a/ext/standard/tests/general_functions/proc_open_null.phpt +++ b/ext/standard/tests/general_functions/proc_open_null.phpt @@ -4,7 +4,10 @@ Null pipes in proc_open() ['null'], 2 => ['pipe', 'w']], $pipes); var_dump($pipes); @@ -15,16 +18,17 @@ $proc = proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes); var_dump($pipes); var_dump(stream_get_contents($pipes[1])); proc_close($proc); +unlink($fn); ?> --EXPECT-- array(1) { [2]=> - resource(4) of type (stream) + resource(6) of type (stream) } string(5) "Error" array(1) { [1]=> - resource(6) of type (stream) + resource(8) of type (stream) } string(4) "Test" diff --git a/ext/standard/tests/general_functions/proc_open_redirect.phpt b/ext/standard/tests/general_functions/proc_open_redirect.phpt index 76940b715d8b..add5e6031ee5 100644 --- a/ext/standard/tests/general_functions/proc_open_redirect.phpt +++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt @@ -4,26 +4,31 @@ Redirection support in proc_open getMessage() . "\n"; } try { - proc_open([$php], [['redirect', 'foo']], $pipes); + proc_open($cmd, [['redirect', 'foo']], $pipes); } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } try { - proc_open([$php], [['redirect', 42]], $pipes); + proc_open($cmd, [['redirect', 42]], $pipes); } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } echo "\nWith pipe:\n"; -$cmd = [$php, '-r', 'echo "Test\n"; fprintf(STDERR, "Error");']; +$fn = tempnam(sys_get_temp_dir(), "PROC_OPEN_TEST"); +file_put_contents($fn, ' ['pipe', 'w'], 2 => ['redirect', 1]], $pipes); var_dump($pipes); var_dump(stream_get_contents($pipes[1])); @@ -49,6 +54,7 @@ unlink($fileName); echo "\nWith inherited stdout:\n"; $proc = proc_open($cmd, [2 => ['redirect', 1]], $pipes); proc_close($proc); +unlink($fn); ?> --EXPECTF-- @@ -60,7 +66,7 @@ Warning: proc_open(): Redirection target 42 not found in %s With pipe: array(1) { [1]=> - resource(4) of type (stream) + resource(6) of type (stream) } string(10) "Test Error" diff --git a/ext/standard/tests/general_functions/proc_open_sockets1.phpt b/ext/standard/tests/general_functions/proc_open_sockets1.phpt index ce5cca9491ed..19608fb606ee 100644 --- a/ext/standard/tests/general_functions/proc_open_sockets1.phpt +++ b/ext/standard/tests/general_functions/proc_open_sockets1.phpt @@ -7,10 +7,9 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); --FILE-- --EXPECTREGEX-- bool\(false\) diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt index 544633f592f6..3c0aa56e44a2 100644 --- a/sapi/cli/tests/016.phpt +++ b/sapi/cli/tests/016.phpt @@ -12,6 +12,7 @@ if (readline_info('done') === NULL) { --FILE-- $code) { echo "\n--------------\nSnippet no. $key:\n--------------\n"; $code = escapeshellarg($code); - echo `echo $code | $php -a`, "\n"; + echo `echo $code | $php $args -a`, "\n"; } echo "\nDone\n"; diff --git a/sapi/cli/tests/023.phpt b/sapi/cli/tests/023.phpt index ae8ac5e8da3b..4dbe436a8a80 100644 --- a/sapi/cli/tests/023.phpt +++ b/sapi/cli/tests/023.phpt @@ -8,18 +8,19 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test"); --FILE-- array("pipe", "w"), ); $pipes = array(); -$proc = proc_open("$php -c $ini_file_escaped -r 'echo ini_get(\"memory_limit\");'", $desc, $pipes); +$proc = proc_open("$php $args -c $ini_file_escaped -r 'echo ini_get(\"max_input_vars\");'", $desc, $pipes); if (!$proc) { exit(1); } @@ -43,5 +44,5 @@ proc_close($proc); unlink(__DIR__ . "/023.ini"); ?> --EXPECT-- -string(3) "40M" +string(1) "4" string(0) "" diff --git a/sapi/cli/tests/bug65275.phpt b/sapi/cli/tests/bug65275.phpt index 9ccb165466ee..e9a326595c37 100644 --- a/sapi/cli/tests/bug65275.phpt +++ b/sapi/cli/tests/bug65275.phpt @@ -4,7 +4,8 @@ Bug #65275: Calling exit() in a shutdown function does not change the exit value diff --git a/sapi/cli/tests/bug74600.phpt b/sapi/cli/tests/bug74600.phpt index 01da61a06604..e52056d40a3f 100644 --- a/sapi/cli/tests/bug74600.phpt +++ b/sapi/cli/tests/bug74600.phpt @@ -8,6 +8,7 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test"); --FILE-- array("pipe", "w"), ); $pipes = array(); -$proc = proc_open("$php -c $ini_file_escaped -r 'echo \"okey\";'", $desc, $pipes); +$proc = proc_open("$php $args -c $ini_file_escaped -r 'echo \"okey\";'", $desc, $pipes); if (!$proc) { exit(1); } diff --git a/sapi/cli/tests/bug78323.phpt b/sapi/cli/tests/bug78323.phpt index d353281a0e86..c9799db9e559 100644 --- a/sapi/cli/tests/bug78323.phpt +++ b/sapi/cli/tests/bug78323.phpt @@ -7,6 +7,7 @@ include "skipif.inc"; --FILE-- &1", $exitCode); +passthru("$php $args -a:Z 2>&1", $exitCode); $output = ob_get_contents(); ob_end_clean(); @@ -28,7 +29,7 @@ echo $lines[0], "\n", // option not found ob_start(); -passthru("$php -Z 2>&1", $exitCode); +passthru("$php $args -Z 2>&1", $exitCode); $output = ob_get_contents(); ob_end_clean(); @@ -40,7 +41,7 @@ echo $lines[0], "\n", // no argument for option ob_start(); -passthru("$php --memory-limit=1G 2>&1", $exitCode); +passthru("$php $args --memory-limit=1G 2>&1", $exitCode); $output = ob_get_contents(); ob_end_clean(); @@ -52,7 +53,7 @@ echo $lines[0], "\n", // Successful execution ob_start(); -passthru("$php -dmemory-limit=1G -v", $exitCode); +passthru("$php $args -dmemory-limit=1G -v", $exitCode); $output = ob_get_contents(); ob_end_clean();