mac brew php nginx_nginx-Brew安装lua模块 brew nginx php mac brew nginx 安装 brew nginx php mysq...

环境:Mac、Brew安装

brew安装很方便,安装完成后可以直接运行nginx的。

安装nginxbrew install nginx-full - -with-lua-module

后面的module选项可以通过如下命令查看:brew options nginx-full--with-accept-language-module

Compile with support for Accept Language module

--with-accesskey-module

Compile with support for HTTP Access Key module

--with-addition

Compile with support for HTTP Addition module

--with-lua-module

Compile with support for LUA module

....

如果安装错误或者想尝试下别的,可以卸载重装brew uninstall nginx-full

(中途若需要安装其它依赖,都可以通过brew安装。因为鼓捣了好久,不确定是不是还需要安装别的)

使用lua

新建lua.conf文件,放到/usr/local/etc/nginx/conf下,conf是新建的文件夹#lua.conf

lua_package_path '/usr/local/Cellar/lua51/5.1.5_4/lib/?.lua;;'; #lua 模块

lua_package_cpath '/usr/local/Cellar/lua51/5.1.5_4/lib/?.so;;'; #c模块

server {

listen 8083;

server_name localhost;

location /lua{

default_type 'text/html';

content_by_lua 'ngx.say("hello world")';

}

}

若没有lua51,通过brew安装就好brew install lua51

引入

在nginx.config文件的http模块下引入文件(可以自己指定位置)include conf/*.conf;

测试nginx -tnginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok

nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successfullocalhost:8083/lua –>hello world

有问题欢迎留言').addClass('pre-numbering').hide();

$(this).addClass('has-numbering').parent().append($numbering);

for (i = 1; i <= lines; i++) {

$numbering.append($('

').text(i));

};

$numbering.fadeIn(1700);

});

});

以上就介绍了nginx-Brew安装lua模块,包括了nginx,brew方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值