mac lnmp环境搭建

2017-12-17  本文已影响0人  孤岛渔夫
pid = /usr/local/var/run/php-fpm.pid

error_log = /usr/local/var/log/php-fpm.log

sudo /usr/local/Cellar/php71/7.1.12_23/sbin/php-fpm -D #启动php-fpm
sudo killall php-fpm #关闭
lsof -Pni4|grep LISTEN | grep php #查看php-fpm

修改nginx配置文件 启动
 vim /usr/local/etc/nginx/nginx.conf
server 下修改
 location / {
            root   html;
            index  index.html index.htm index.php;
        }

 location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
保存并启动 sudo nginx  访问 127.0.0.1:8080 就可用.php文件了
上一篇下一篇

猜你喜欢

热点阅读