Hello,
I've just migrated and upgraded our company's MediaWiki to a new server. Windows Server 2012 R2, Apache 2.4.33 64bit + PHP 7.1.19 64bit + Python 3.6 64bit, MediaWiki 1.31.0.
Everything works except the SyntaxHighlight extension. The error message:
Notice: Failed to invoke Pygments: 'C:\Python36\Scripts\pygmentize.exe" "-l" "css" "-f" "html" "-O" "cssclass' is not recognized as an internal or external command, operable program or batch file.
[Called from SyntaxHighlight::highlight in C:\Apache24\htdocs\wiki\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php at line 336] in C:\Apache24\htdocs\wiki\includes\debug\MWDebug.php on line 309
The PATH is set correctly, and from a sample test php file I can call Pygments, and it works:
<?php
$output = shell_exec('C:\Python36\Scripts\pygmentize.exe -l php -f html -O cssclass C:\Apache24\htdocs\test2.php');
echo "$output";
?>
The previous version (MediaWiki 1.26.4) used an external lib for shell commands, and it has worked on Windows: use Symfony\Component\Process\ProcessBuilder;
The current MediaWiki 1.31.0 use the built-in MediaWiki Shell: use MediaWiki\Shell\Shell;