brew is a application management component in the mac system , use it to install nginx and php is very convenience .
install nginx
$ brew install nginx
$ brew tap homebrew/dupes
$ brew tap josegonzalez/homebrew-php
$ brew install php54 --with-mysql --with-fpm
#install php5.4 if you want 5.5,execute brew install php55,but advice you install 5.4 , hehe , because we use nginx to interactive with php , maybe we should with php-fpm
To run the php-fpm
$ php-fpm
change the nginx.conf file , the line include location php
location ~ \.php$ {
root /var/www;
#root is you web dir direction
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
#$document_root just the same as root , option
include fastcgi_params;
}