Closed brynne8 closed 2 years ago
Why is it misleading? I find that it's safer to reference the libs from the ZeroBrane Studio folder rather than to copy them to the NGINX folders, but you definitely have the option of doing it the way you described.
Because we often don't need to use lua and c libraries from ZeroBrane in a real-world nginx-lua application. We often point the paths elsewhere where our luajit and batteries installed, and use ZeroBrane as a remote debugger.
I agree, but the instructions are in the context of debugging that application and you'd need that reference to debug it (and wouldn't need in all other cases).
ref: http://notebook.kulchenko.com/zerobrane/debugging-openresty-nginx-lua-scripts-with-zerobrane-studio
MobDebug is one of the best ways to debug OpenResty. But the doc is a bit misleading about the configuration. In the example config
It points the lua package path and cpath to the libs in the ZeroBrane Studio path, which isn't common way of setting these paths. This example made us to think that MobDebug relies on libraries introduced by ZeroBrane to work, but actually only LuaSocket is needed for debugging, and pointing the paths to
<ZBS>/...
is not needed.The LuaSocket binary lib can also be incompatible with OpenResty or ngx-lua, so it's better to tell people to install LuaSocket compatible with OpenResty, or to compile LuaSocket themselves using the same environment as OpenResty.