当前位置: 首页 > 工具软件 > NGINXConfig > 使用案例 >

nginx config php in mac system

西门智
2023-12-01

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

 类似资料:

相关阅读

相关文章

相关问答