Thank you very much for your patient and for your help. The problem is a copy past, so maybe a bad translates of php because cifi is not a frensh word. So it can be possible it's cffi.
Now I am in thread-safe dll.
I try to put lua5.1 in the parent file and it doesn’t work.
I shear in phpinfo if don't miss something and I find an old reference in PHP Variables $_SERVER['PATH'] and in the environment Path I have this path C:\Program Files (x86)\WinLua\Lua\5.3\bin\;
I uninstall winlua and it is still in the php configuration, so I uninstall xampp and install it again. The line still here... maybe here we have the error so how can I really unstall it?
I have already an error, I remove lua5.1 from C:\xampp\php
and I don't have an error in php.exe. And when lua5.A is in C:\xampp\php
I have the same result.
SO my actualle configuration it'sphp 8.1.2 I have the line extension=php_luasandbox.dll in php.ini
, I have C:\xampp\php\ext\php_luasandbox.dll
and C:\xampp\php\lua5.1.dll
I try the example code (I don't think it's coding errors) but I have this error.
Fatal error: Uncaught Error: Class "LuaSandbox" not found in C:\xampp\htdocs\mediaWikiTest\infoPHP.php:8 Stack trace: #0 {main} thrown in C:\xampp\htdocs\mediaWikiTest\infoPHP.php on line 8
contenue de infoPhp.php
<?php //GET info php
echo "pcre: " . ( extension_loaded( "pcre" ) ? PCRE_VERSION : "no" ) . "\n";
echo "pcntl: " . ( extension_loaded( "pcntl" ) ? "yes" : "no" ) . "\n";
echo "mbstring: " . ( extension_loaded( "mbstring" ) ? "yes" : "no" ) . "\n";
phpinfo();
echo "=============================luaTest==============================\n";//code from https://www.php.net/manual/en/luasandbox.examples-basic.php
$sandbox = new LuaSandbox;
$sandbox->setMemoryLimit( 50 * 1024 * 1024 );
$sandbox->setCPULimit( 10 );
// Register some functions in the Lua environment
function frobnosticate( $v ) {
return [ $v + 42 ];
}
$sandbox->registerLibrary( 'php', [
'frobnosticate' => 'frobnosticate',
'output' => function ( $string ) {
echo "$string\n";
},
'error' => function () {
throw new LuaSandboxRuntimeError( "Something is wrong" );
}
] );
// Execute some Lua code, including callbacks into PHP and into Lua
$luaCode = <<<EOF
php.output( "Hello, world" );
return "Hi", function ( v )
return php.frobnosticate( v + 200 )
end
EOF;
list( $hi, $frob ) = $sandbox->loadString( $luaCode )->call();
assert( $frob->call( 4000 ) === [ 4242 ] );
// PHP-thrown LuaSandboxRuntimeError exceptions can be caught inside Lua
list( $ok, $message ) = $sandbox->loadString( 'return pcall( php.error )' )->call();
assert( !$ok );
assert( $message === 'Something is wrong' );
?>
And I try with littel hopes to run with mediawiki and when I import the tamplate notice I have this error : Échec de l’importation : The luasandbox extension is not present, this engine cannot be used.
Translation of French part : import failed : ....
It's like it doesn’t exist.