Openresty ffi.load() .so文件的路径设置,


一、错误出现

local lib = ffi.load("libxxx")

-- 出现以下错误:

[error] 27899#0: *26 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:471):3: libxxx.so: cannot open shared object file: No such file or directory

二、解决方法

ffi.load(name) 会根据C链接库的地址开始寻找,可通过增加

vim /etc/ld.so.conf                    # 增加你的.so链接库目录

ldconfig                               # 保存后执行ldconfig

# ffi就会在新增加的C链接库目录找到你的.so文件

 

相关内容

    暂无相关文章