Closed trompx closed 10 years ago
you can do the following steps to make sure it loaded correctly
if nothing output then means lua extension is not loaded.
then you may find some warnings about why it wasn't loaded correctly
Just tried : php -m | grep lua and I get "lua" output so it loads correctly.
Basically I was trying to implement php lua as I could not figure it out how to pass a php object directly in an $redis->eval.
Exemple : $obj = new stdClass; $obj->attr1= $val1; $obj->attr2= $val2;
Then I was trying something like : $redis->eval( "local newobj = ".$obj." ");
But I was getting errors due to incorrect object format in lua. If this can helps someone, for this to work I had to correctly format it this way:
$redis->eval(" local newobj = {['attr1']= '".$attr1."', ['attr2']= '".$attr2."'} ");
But thanks for your input !
okey, thanks for feedback, I am going to close this. :)
Hello laruence,
I'm pretty new to the linux world but I gave it a try at installing php-lua in order to play with some lua scripts in laravel.
I create a simple php file : $lua = new Lua(); $lua->assign("php_var", array(1=>1, 2, 3)); var_dump($lua->php_var);
If I launch it from linux terminal, I get the correct output.
When trying the same code inside a laravel class, I get the following message : "Class 'Lua' not found".
Do you know if there is some extra setup steps required to make it work with laravel ? I added extension=lua.so to php.ini file.
Thank you !