macos下用port安装nginx搭建php环境

macos下用port安装nginx搭建php环境

ID:17570972

大小:36.50 KB

页数:4页

时间:2018-09-03

macos下用port安装nginx搭建php环境_第1页
macos下用port安装nginx搭建php环境_第2页
macos下用port安装nginx搭建php环境_第3页
macos下用port安装nginx搭建php环境_第4页
资源描述:

《macos下用port安装nginx搭建php环境》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、MacOS下用Port安装nginx搭建PHP环境驱动:http://bbs.pcbeta.com/viewthread-936053-1-1.htmlDSDT:http://bbs.pcbeta.com/viewthread-947666-1-1.htmlmacport下载地址安装porthttp://www.macports.org/install.php安装之前请先下载Xcode4.2lion。根据里面的说明安装MacProt即可。接下来安装nginx在Mac上使用macport安装和配置Nginx非

2、常方便,首先安装nginxsudoportinstallnginxspawn-fcgi安装完成后启动nginx会说没有nginx.conf文件,到/opt/local/etc/nginx目录下看到以下几个文件:fastcgi_params.examplekoi-utfkoi-winmime.types.examplenginx.conf.examplewin-utf直接复制example文件:sudomvmime.types.examplemime.typessudomvnginx.conf.example

3、nginx.conf启动nginx:sudonginx访问http://127.0.0.1/,就可以看到Nginx的Welcome页面。如何重启nginx?#检测配置文件是否有效sudonginx-t#重启sudonginx-sreload#帮助sudonginx-h默认的nginx配置不是很好用,下面调整一下cd/opt/local/etc/nginx/sudomkdirconf.dsudomkdirsites-availablesudomkdirsites-enabled文件nginx.conf的配置h

4、ttp部分:http{includemime.types;default_typeapplication/octet-stream;log_formatmain'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent"$http_referer"''"$http_user_agent""$http_x_forwarded_for"';access_loglogs/access.logmain;sendfileon;t

5、cp_nopushon;keepalive_timeout10;#keepalive_timeout65;gzipon;include/opt/local/etc/nginx/conf.d/*.conf;include/opt/local/etc/nginx/sites-enabled/*;}然后站点配置文件放在目录sites-available里,在目录sites-enabled中做ln-s../sites-available/xxx.conf./即可php5安装php5,扩展模块根据自己的需要调整#su

6、doportinstallphp5+fastcgifcgiphp5-gdphp5-mysqlphp5-sqlitephp5-eacceleratorphp5-curlphp5-iconv#配置文件cd/opt/local/etc/php5sudocpphp.ini-developmentphp.ini将时区修改为:date.timezone=Asia/Chongqing错误级别修改为:error_reporting=E_ALL&~E_NOTICEphp-fcgicd/Library/LaunchDaemon

7、s/sudovimorg.macports.phpfcgi.plist文件org.macports.phpfcgi.plist内容如下:Labelorg.ma

8、cports.phpfcgiDebugOnDemandRunAtLoadEnvironmentVariablesPHP_FCGI_CHILDREN2PHP_FCGI_MAX_REQUE

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。