Skip to content

Commit eeab3be

Browse files
author
Anatoliy Belsky
committed
Fix bug #61459 popen_close_basic-win32 can't run sort.exe
1 parent bff8152 commit eeab3be

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/standard/tests/file/popen_pclose_basic-win32.phpt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ pclose($file_handle);
2828

2929
echo "*** Testing popen(): writing to the pipe ***\n";
3030
$arr = array("ggg", "ddd", "aaa", "sss");
31-
$file_handle = popen("sort", "w");
31+
// popen("sort", "w") fails if variables_order="GPCS"
32+
// this is set in the default INI file
33+
// it doesn't seem to be changeable in the --INI-- section
34+
// also, doing: ini_set('variables_order', ''); doesn't work!
35+
//
36+
// the only solution is to either put the absolute path here, or
37+
// remove variables_order= from PHP.ini (setting it in run-test's
38+
// default INI will fail too)
39+
//
40+
// since we can't depend on PHP.ini being set a certain way,
41+
// have to put the absolute path here.
42+
$file_handle = popen("/windows/system32/sort", "w");
3243
$newline = "\n";
3344
foreach($arr as $str) {
3445
fwrite($file_handle, (binary)$str);

0 commit comments

Comments
 (0)