Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 使用opm包管理器从openresty访问socket.ltn12 上下文 openresty6.x_Lua_Openresty_Luarocks - Fatal编程技术网

Lua 使用opm包管理器从openresty访问socket.ltn12 上下文 openresty6.x

Lua 使用opm包管理器从openresty访问socket.ltn12 上下文 openresty6.x,lua,openresty,luarocks,Lua,Openresty,Luarocks,ltn12是来自luasocket库的模块 此库可以与luarock软件包管理器一起安装 Openresty不鼓励使用for 但是我在OPM中找不到任何可用的luasocket库或ltn12模块 问题: 如何使用OPM使用luasocket库中的ltn12模块 编辑(临时解决方案) 该软件包在OPM上提供,并提供可通过require resty.smtp.ltn12访问的ltn12 您可以复制软件包中可用的lib/resty/smtp/ltn12.lua,不要忘记将模块名称更改到文件中 Lua

ltn12
是来自
luasocket
库的模块

此库可以与
luarock
软件包管理器一起安装

Openresty
不鼓励使用for

但是我在
OPM
中找不到任何可用的
luasocket
库或
ltn12
模块

问题: 如何使用
OPM
使用
luasocket
库中的
ltn12
模块

编辑(临时解决方案)
  • 该软件包在OPM上提供,并提供可通过
    require resty.smtp.ltn12访问的
    ltn12
  • 您可以复制软件包中可用的
    lib/resty/smtp/ltn12.lua
    ,不要忘记将模块名称更改到文件中

Luarock由openresty支持。它不是捆绑的,但您可以为捆绑版本的openresty安装它。请按照此处的说明操作:

并将
/usr/local/openresty/luajit
替换为您自己的
openresty/luajit
路径

wget http://luarocks.org/releases/luarocks-2.0.13.tar.gz
tar -xzvf luarocks-2.0.13.tar.gz
cd luarocks-2.0.13/
./configure --prefix=/usr/local/openresty/luajit \
    --with-lua=/usr/local/openresty/luajit/ \
    --lua-suffix=jit \
    --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install