None of this worked for me either, I have gone through the PHP itself and there is little to no information I could find that helped solve the problem.
Instead I have opted to replace the faulty section of code with some basic PHP script that seems to work (at least for my machine).
Try this fix:
Open SyntaxHighlight.class.php in the mediawiki\extensions\SyntaxHighlight_GeSHi folder
Scroll to around line 211 to find the highlight function
Towards the end of this function, you should see an if statement like:
if ( $output === false) {
// does stuff here
}
Simply replace this entire if block with the following script, and it should fix the problem for you (edit the Python executable path as needed for your installation of course):
if ( $output === false ) {
$optionPairs = [];
foreach ( $options as $k => $v ) {
$optionPairs[] = "{$k}={$v}";
}
$execCmd = 'C:\\Python27\\python.exe ' . self::getPygmentizePath() . ' -f html -l ' . $lexer . ' -O ' . implode( ',', $optionPairs );
$descriptorSpec = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w')
);
$proc = proc_open($execCmd, $descriptorSpec, $pipes);
fwrite($pipes[0], $code);
fclose($pipes[0]);
$output = stream_get_contents($pipes[1]);
fclose($pipes[1]);
proc_close($proc);
$cache->set( $cacheKey, $output );
}
---
This should hopefully be a fix, if the results don't appear straight away it might be due to caching, in which case you can add $output = false; just before the if statement to reset it.
Hope it works for anyone else that's having problems, tested this on IIS 10