码迷,mamicode.com
首页 > Web开发 > 详细

freebsd上安装nginx+php记录

时间:2015-09-05 11:06:17      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

参考文章 

https://wiki.freebsdchina.org/faq/ports

http://www.vpsee.com/2014/04/install-nginx-php-apc-mysql-on-freebsd-10-0/

http://www.oschina.net/question/725072_155574

 

------------------------------------------------------------------------------------------------

1 -   设置 portsnap 安装更新 ports

2 -   安装php

3 -   安装nginx

 

------------------------------------------------------------------------------------------------

1 -   设置 portsnap 安装更新 ports

vi /etc/portsnap.conf

 

//设置:

SERVERNAME=portsnap.cn.freebsd.org

//你可以设置相对你速度快点的服务器的地址

portsnap fetch extract 

//安装更新ports

2 -   安装php

cd /usr/ports/lang/php55
make install clean; rehash
cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

service php-fpm start

3 -   安装nginx

配置nginx.conf

vi /usr/local/etc/nginx/nginx.conf

对location ~ \.php$ 部分改动如下:

location ~ \.php$ {
            root   /usr/local/www/nginx;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

重启nginx

nginx -s reload

 

freebsd上安装nginx+php记录

标签:

原文地址:http://www.cnblogs.com/misstaste/p/4782855.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!