I've, somehow, managed to play with LUA on my local machine (Windows). Now I tried to put that on my dev server (Debian 9 with Apache 2.4.25 with PHP 7.0.27-0+deb9u1 and Lua 5.3.3).
After hours, dozens of errors and thousands of StackOverflow's pages read, I have finally been able to manually compile and build PECL lua-2.0.5 and successfully made apache module.
I used $ a2enmod lua. Now, on phpinfo() I see mod_lua along others Loaded Modules.
I can run lua scripts from cli. No problem here.
I can't use lua from PHP scripts:
Fatal error: Uncaught Error: Class 'Lua' not found in [...]
I can't use lua through Apache as well (through http://domain/path/to.lua), even after editing /etc/apache2/apache2.conf with new lines:
LoadModule lua_module modules/mod_lua.so
<Files "*.lua">
SetHandler lua-script
</Files>
None of the 4 line made any noticeable difference.
Running Lua scripts directly through Apache (from URL) is optional. But I really need to be able to interpret Lua from my PHP scripts. But even with mod_lua displayed in Loaded Modules in phpinfo(), PHP can't find class Lua. Why?
PECL lua-2.0.5andLua 5.3.3fromaptitude, but all it did was making apache module. It is seen by PHP inphpinfo(), but still, noLuaclass ://etc/php/7.0/apache2/php.ini? or its conf.d own ini? tried to install lua via pecl but found some errors, but I remember that some extensions that use apache mods also needs you to explicity set the php.ini optionextension=lua.soto mainphp.iniand it works now. Post an answer if you want