nginx lua 找不着ffi模块

原创
2018/04/18 16:13
阅读数 4K

2018/04/18 07:18:41 [error] 7304#0: *10 lua entry thread aborted: runtime error: ...ua_extend/lua_lib/lua-resty-string/lib/resty/md5.lua:4: module 'ffi' not found:
        no field package.preload['ffi']
        no file '/usr/local/imageNginx/lua_extend/lua_lib/lua-resty-string/lib/ffi.lua'
        no file '/usr/local/imageNginx/lua_extend/lua_lib/lua-resty-upload/lib/ffi.lua'
        no file './ffi.lua'
        no file '/usr/local/share/lua/5.1/ffi.lua'
        no file '/usr/local/share/lua/5.1/ffi/init.lua'
        no file '/usr/local/lib/lua/5.1/ffi.lua'
        no file '/usr/local/lib/lua/5.1/ffi/init.lua'
        no file '/usr/share/lua/5.1/ffi.lua'
        no file '/usr/share/lua/5.1/ffi/init.lua'
        no file '/usr/local/luajit/lib/lua/5.1/ffi.so'
        no file './ffi.so'
        no file '/usr/local/lib/lua/5.1/ffi.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/ffi.so'
        no file '/usr/lib/lua/5.1/ffi.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
 

出现以上错误为未加载luajit模块。在编译安装的nginx时候一定要注意添加luajit的lib、include/luajit-2.0的环境变量

export LUAJIT_LIB=/usr/local/luajit/lib  

export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0

 

判定是否为lua/还是的luajit:nginx.say(_version) 输出有版本号为lua,nginx.say(jit.version)输出版本号luajit

查看nginx 使用的lua类库 ldd  /usr/local/nginx/sbin/nginx  |grep lua  是否为luajit

 

http://www.04007.cn/article/413.html

 

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部