标签归档:nginx

mac lion下安装nginx

os x 虽然也算是unix族 但最近使用下来感觉还是和linux有很大差异性的(useradd)

搭建环境实在是折腾了一番,遂记录下来。

本机环境 os x 10.8.3

Nginx

声明:linux下安装nginx需要pcre pcre-devel zlib zlib-devel openssl openssl-devel  

其实在mac下根本不需要这么麻烦 只要安装一个pcre即可 我在编译zlib的过程中就出了好多问题。

步骤:

brew install pcre

brew install nginx

都可以去官网down下源码编译安装  

启动nginx     ./nginx 

注意:若nginx的监听端口为1024以下,则需要使用sudo nginx ,否则会出现Permission denied.(nginx默认端口为8080 )

PHP

os x 自带php  php -v查看版本

mbp:nginx haidx$ php -v
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 28 2012 18:19:13)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

mbp:nginx haidx$ whereis php
/usr/bin/php

在/usr/bin下  版本太低 自我感觉不太良好 升级之

mbp:nginx haidx$ brew serach php
Error: Unknown command: serach
mbp:nginx haidx$ brew search php
No formula found for “php”. Searching open pull requests…

发现找不到php…   感觉不太科学… google之

发现个新玩意叫 brew tap

what is brew tap?看下面-.-

============>>>>

The main new feature in Homebrew-0.9 is brew tap.

brew-tap allows you to import formula from other repositories into your Homebrew instance. For example:

 <<<=============

安装方法:

Tap the homebrew/dupes repository into your brew installation:

Tap the repository into your brew installation:

Note: For a list of available configuration options run:

Then install php53, php54, or any formulae you might need:

That’s it!

 好了

mbp:nginx haidx$ brew install –without-apache –with-fpm –with-mysql php54
==> Installing php54 dependency: freetype
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/freetype-2.4.11.mountain_lion.bottle.tar.gz

curl: (56) Recv failure: Connection reset by peer
Warning: Bottle installation failed: building from source.
==> Downloading http://downloads.sf.net/project/freetype/freetype2/2.4.11/freetype-2.4.11.tar.gz

curl: (56) Recv failure: Connection reset by peer
Error: Download failed: http://downloads.sf.net/project/freetype/freetype2/2.4.11/freetype-2.4.11.tar.gz

感谢ccav…感谢天朝… 感谢GFW… sf是被墙的货….幸好有神器。。

echo “–proxy 127.0.0.1:8087″  >> ~/.curlrc

执行这条命令就可以了  让curl走神器通道~

未完待续。。。

 

https://github.com/josegonzalez/homebrew-php