• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

openresty下提示nginx:…unknowndirective"content_by_lua_block" ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

照着文档(http://openresty.org/cn/getting-started.html)的提示写个openresty的helloworld,运行  nginx -p `pwd`/ -c conf/nginx.conf  时出现:…unknown directive "content_by_lua_block" ,有的博客说是安装的openresty的版本过低,但我寻思着我的是最新版,应该不是这个原因,后来看到这篇讨论:https://segmentfault.com/q/1010000019781462/,感觉有点方向了,又在github上看到:https://github.com/openresty/lua-nginx-module/issues/1554一段这样的话:

Seems like you're not invoking openresty's nignx. 
You may have multiple nginx executables in your system.
Try invoking openresty's nginx binary explicitly via its full path instead of relying on changing PATH environment variable values.

猜测原因是自己使用的nginx不是openresty中的自带的nginx。

后来猛地想起,自己在执行 ./configure的时候貌似忽略了一些参数。。。

官方给出的参考参数如下:(忘了自己当时少添加了哪个(或者是根本没有加参数))

./configure --prefix=/opt/openresty \
            --with-luajit \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module

于是重新执行编译一次openresty,这次将上面的后四个参数全加上去,再按照之前的步骤来,执行成功!

稍作记录,如果你遇到相同的问题,希望可以帮到你!


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
lua序列化(支持循环引用)发布时间:2022-07-22
下一篇:
【lua】如何倒序查找字符发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap