请教一个问题噢~~(通过邮件发送了,不过我在论坛没有收到,所有又在论坛发一次)
需求说明:
根据输入参数,通过lua文件查询mysql,并且返回对应的输出数据,然后根据数据的不同去做后续工作.
配置文件摘录:
server {
listen 8080;
server_name localhost;
root html;
index index.html index.htm;
location / {
set_by_lua_file $res conf/limit_mysql.lua $arg_uid;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
错误提示:
*1 failed to run set_by_lua*: /usr/local/openresty/lualib/resty/mysql.lua:458: API disabled in the context of set_by_lua*stack traceback:
[C]: in function 'tcp'
/usr/local/openresty/lualib/resty/mysql.lua:458: in function 'new'
/usr/local/openresty/nginx/
conf/limit_mysql.lua:2: in function </usr/local/openresty/nginx/conf/limit_mysql.lua:1>, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "127.0.0.1:8080"2014/06/10 14:45:37 [error] 9541#0: *1 failed to run set_by_lua*: /usr/local/openresty/lualib/resty/mysql.lua:458: API disabled in the context of set_by_lua*stack traceback: [C]: in function 'tcp'
/usr/local/openresty/lualib/resty/mysql.lua:458: in function 'new'
/usr/local/openresty/nginx/
conf/limit_mysql.lua:2: in function </usr/local/openresty/nginx/conf/limit_mysql.lua:1>, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "127.0.0.1:8080"2014/06/10 14:45:37 [error] 9541#0: *1 failed to run set_by_lua*: /usr/local/openresty/lualib/resty/mysql.lua:458: API disabled in the context of set_by_lua*stack traceback:
[C]: in function 'tcp' /usr/local/openresty/lualib/resty/mysql.lua:458: in function 'new'
/usr/local/openresty/nginx/
conf/limit_mysql.lua:2: in function </usr/local/openresty/nginx/conf/limit_mysql.lua:1>, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "127.0.0.1:8080"
mysql.lua提示错误的那几行代码是:
/usr/local/openresty/lualib/resty/mysql.lua
457 function _M.new(self)
458 local sock, err = tcp()
459 if not sock then
460 return nil, err
461 end
462 return setmetatable({ sock = sock }, mt)
463 end