作者:skyyyf | 来源:互联网 | 2023-08-19 02:34
12345678910111213141516 location /test_lua { default_type 'text/plain'; content_by_lu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| location /test_lua {
default_type 'text/plain';
content_by_lua 'ngx.say("hello, lua")';
}
能执行并在页面中输入hello,lua
但是在日志中会提示如下:
2019/03/13 12:38:01 [alert] 13305#0: detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
执行这部分时
access_by_lua_block {
local command = "gm convert /home/img/test_o.jpg -thumbnail 300x425 /home/img/test_lua.jpg";
os.execute(command);
}
则日志中出现以下错误,并且根本不执行gm这行,gm这行单独在linux命令行下是能执行成功的
2019/03/13 12:38:08 [alert] 13305#0: detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
sh: gm: command not found |
请问以上情况是什么原因?谢谢!!!!!!!!
我的配置环境如下:(以下都是单独安装,没有安装openresty)
centos7.6
nginx 1.14.1
GraphicsMagick-1.3.31
lua-5.3.5
LuaJIT-2.0.5
zlib-1.2.11
yum install git
git clone https://github.com/simpl/ngx_...
git clone https://github.com/openresty/...