开发者社区> 问答> 正文

nginx+lua+memcached,报错:module 'resty.mem?报错

2015/02/04 12:04:23 [error] 31306#0: *1 lua entry thread aborted: runtime error: /usr/local/nginx/conf/vhost/cache.lua:25: module 'resty.memcached' not found:
        no field package.preload['resty.memcached']
        no file './resty/memcached.lua'
        no file '/usr/local/share/luajit-2.0.3/resty/memcached.lua'
        no file '/usr/local/share/lua/5.1/resty/memcached.lua'
        no file '/usr/local/share/lua/5.1/resty/memcached/init.lua'
        no file './resty/memcached.so'
        no file '/usr/local/lib/lua/5.1/resty/memcached.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './resty.so'
        no file '/usr/local/lib/lua/5.1/resty.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
coroutine 0:
        [C]: in function 'require'
        /usr/local/nginx/conf/vhost/cache.lua:25: in function </usr/local/nginx/conf/vhost/cache.lua:1>, client: 192.168.1.10, server: localhost, request: "GET /?cmd=get&key=123ab HTTP/1.1", host: "192.168.1.251"



这个是不是有什么模块没有安装?



展开
收起
爱吃鱼的程序员 2020-06-14 17:59:09 674 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    找不到memcached模块,看看环境变量和nginx加入lua的默认路径

    引用来自“batcom”的评论

    找不到memcached模块,看看环境变量和nginx加入lua的默认路径

    lua_package_path"/usr/lib64/lua/5.1/?.lua;;"; 这个就是nginx加载lua库的默认路径;;后面两个分号即代表环境变量搜索路径,具体看ngx_lua中  lua_package_path指令用法

    2020-06-14 17:59:26
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载