天天看点

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

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

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

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

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

cat /etc/ld.so.conf

include ld.so.conf.d/*.conf

echo “/usr/local/lib” >> /etc/ld.so.conf

ldconfig

然后就正常了。

可以去测试下:

修改nginx.conf配置文件

server加入:

location /hello {

default_type’text/plain’;

content_by_lua’ngx.say(“Hello Lua!”)’;

}

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

继续阅读