nginx config php in mac system

来源:互联网 发布:521069新域名 编辑:程序博客网 时间:2024/06/07 05:49

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

install php

$ 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

Maybe you will occur many error , but no ploblem , you can beat it . 

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;            }  


that's OK

0 0
原创粉丝点击