首页 > 解决方案 > 在Linux中安装Lua并实现PHP Lua Extension

问题描述

我通过以下方式安装了 Lua:

apt-get install lua5.3 lua5.3-dev

然后做了

pecl install lua

这给了我这个错误:Please reinstall the lua distribution - lua.h should be in <lua-dir>/include/

但我不知道这<lua-dir>应该在哪里。遵循这个问题中的说明: lua php extension installation via pecl failed didn't help

标签: phplinuxluapecl

解决方案


解决方案:

pecl download lua
cd lua-2.0.7
phpize
./configure --with-lua-version=5.3
make
cp modules/lua.so /usr/lib/php/20151012/lua.so

在 php.ini 中添加:

extension=lua.so

推荐阅读