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!提示就完全沒問題了。