nginx安装lua模块 出现LIBLUAJIT-5..2错误的解决方法

时间:2025-03-23 08:06:36

nginx在单独安装lua模版的时候,出现一个错误,我不知道其他人有没有遇到过。

编译都没有问题,就是在nginx -t检查的时候,有以下错误:

nginx: error while loading shared libraries: libluajit-5..2: cannot open shared object file: No such file or directory

出现这个错误,是变量没有写进去,所以就添加下变量:

cat /etc/
include /*.conf
echo “/usr/local/lib” >> /etc/
ldconfig
然后就正常了。

可以去测试下:

修改配置文件
server加入:
location /hello {
default_type’text/plain’;
content_by_lua’(“Hello Lua!”)’;
}

访问出现Hello Lua!提示就完全没问题了。