]> granicus.if.org Git - php/commitdiff
Fix #78283: no output for explicit environment
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 13 Jul 2019 10:01:33 +0000 (12:01 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 13 Jul 2019 10:03:03 +0000 (12:03 +0200)
This test does not work on Windows, if the child process has OPcache
enabled via php.ini, since TEMP is not set in the environment, so
OPcache can't find the base address file, and terminates the childs.

To avoid this (and potentially some other issues regarding missing
environment variables, such as PATH), we force the child process to
ignore any ini files.

ext/standard/tests/general_functions/proc_open_array.phpt

index a975c02a993cf366f100d2c79c5d276b91dfc65f..8b42a55bacaf626e08395329c96826477c31760e 100644 (file)
@@ -26,7 +26,7 @@ proc_close($proc);
 
 putenv('ENV_1=ENV_1');
 $env = ['ENV_2' => 'ENV_2'];
-$cmd = [$php, '-r', 'var_dump(getenv("ENV_1"), getenv("ENV_2"));'];
+$cmd = [$php, '-n', '-r', 'var_dump(getenv("ENV_1"), getenv("ENV_2"));'];
 
 echo "\nEnvironment inheritance:\n";
 $proc = proc_open($cmd, $ds, $pipes);