(I'm still new to Wiki, so excuses if this is the wrong forum/format/question, but please bare with me.)
I have a fresh install of WikiMedia version 1.35, running on IIS (Windows 2016. It can't be avoided to run on Windows). After installing the usual extensions, I run into a problem with Scribunto. As per the manual, I have in my LocalSettings.php:
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
error_reporting( -1 );
ini_set( 'display_errors', 1);
$wgShowExeptionDetails = true;
$wgDebugLogFile = "D:/log/debug-{$wgDBname}.log";
$wgScribuntoEngineConf['luastandalone']['errorFile'] = 'D:/log/scribunto.log';
On a page I have the line below in the source (without the tildes, or that would be interpreted here):
~{~{\#invoke:main|main~}~}
When viewing the page, I get the error: Lua error: Internal error: The interpreter exited with status 1.
In the log file I see this:
[Scribunto] Scribunto_LuaStandaloneInterpreter::__construct: creating interpreter: ""D:\wwwroot\kb\extensions\Scribunto\includes\engines\LuaStandalone/binaries/lua5_1_5_Win64_bin/lua5.1.exe" "D:\wwwroot\kb\extensions\Scribunto\includes\engines\LuaStandalone/mw_main.lua" "D:\wwwroot\kb\extensions\Scribunto\includes" "0" "8""
As you can see, there is a mix of slashes and backslashes which may the cause of the error (?)
Doing some searching in the code, it seem to come from: LuaStandaloneInterpreter.php
In particular the lines:
$options['luaPath'] = __DIR__ . "/binaries/$path";
and:
__DIR__ . '/mw_main.lua',
Where __DIR__ has the value: "D:\wwwroot\kb\extensions\Scribunto\includes\engines\LuaStandalone", while the code seems to expect to be "D:/wwwroot/kb/extensions/Scribunto/includes/engines/LuaStandalone"
I don't see where __DIR__ gets initialized, so the problem could be in a different PHP file?
I have also tried to add the below line to my LocalSettings.php:
#$wgScribuntoEngineConf['luastandalone']['luaPath'] = 'D:/wwwroot/kb/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_Win64_bin/lua5.1.exe';
After which the page still doesn't work and logs shows this:
[Scribunto] Scribunto_LuaStandaloneInterpreter::__construct: creating interpreter: ""D:/wwwroot/kb/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_Win64_bin/lua5.1.exe" "D:\wwwroot\kb\extensions\Scribunto\includes\engines\LuaStandalone/mw_main.lua" "D:\wwwroot\kb\extensions\Scribunto\includes" "0" "8""
So that only partially fixed the problem, but the filepath to mw_main.lua still has mixed slashes.
I have made some changes to LuaStandaloneInterpreter.php by hardcoding the path (just for testing). The log now shows:
[Scribunto] Scribunto_LuaStandaloneInterpreter::__construct: creating interpreter: ""D:/wwwroot/kb/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua5_1_5_Win64_bin/lua5.1.exe" "D:/wwwroot/kb/extensions/Scribunto/includes/engines/LuaStandalone/mw_main.lua" "D:/wwwroot/kb/extensions/Scribunto/includes" "0" "8""
But I still get the same error on the page and in the Scribunto.log file shows this:
'""D:' is not recognized as an internal or external command, operable program or batch file.
Which seems to indicate that it doesn't like the drive letter?
Removing the drive letter from the code, gives a similar output as above (without the drive letter) but the Scribunto.log files shows:
'""' is not recognized as an internal or external command, operable program or batch file.
After extensive Googling and trying different options, I don't know what else to do, but hopefully, the above informaiton will make more sense to an expert? Thanks for your help in advance!!
Ps. I have checked that all folders and files mentioned here exist and the process has access to it.