商会资讯

 找回密码
 立即注册

QQ登录

只需一步,快速开始

用新浪微博连接

一步搞定

搜索
热搜: 活动 交友 discuz

FreeBSD 9.0中Php 5.3和Nginx 1的安装

已有 3510 次阅读2012-10-20 08:34 |个人分类:linux|

shell>vi/etc/rc.d/rc.local
shell>chmod 555 /etc/rc.d/rc.local

php
1、准备编译环境:libxml2和libiconv
shell>pkg_add-r libxml2

a、libxml2
shell>fetch ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
shell>tar xvf libxml2-2.7.8.tar.gz
shell>cd libxml2-2.7.8
shell>./configure
shell>make
shell>make install
b、libiconv
shell>fetch http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
shell>tar xvf libiconv-1.14.tar.gz
shell>cd libiconv-1.14
shell>./configure
shell>make
shell>makeinstall
2、准备源代码
shell>fetch http://cn.php.net/distributions/php-5.3.10.tar.gz
shell>tar xvf php-5.3.10.tar.gz
shell>cd php-5.3.10
3、源码配置
shell>mkdir/usr/local/lib/php
shell>./configure--enable-fpm --with-config-file-path=/usr/local/lib/php
4、编译
shell>make
5、安装
shell>make install
shell>make clean
6、安装配置
shell>cp php.ini-development /usr/local/lib/php/php.ini
shell>cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
7、启动
shell>echo /usr/local/sbin/php-fpm >>/etc/rc.d/rc.local

nginx
1、准备编译环境:pcre
shell>pkg_add -r pcre

shell>fetch ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
shell>tar xvf pcre-8.30.tar.gz
shell>cd pcre-8.30
shell>./configure
shell>make
shell>make install
2、准备源代码
shell>fetch http://nginx.org/download/nginx-1.0.11.tar.gz
shell>tar -xvf nginx-1.0.11.tar.gz
shell>cd nginx-1.0.11
3、源码配置
shell>./configure
4、编译
shell>make
5、安装
shell>make install
shell>make clean
6、安装配置
shell>vi /usr/local/nginx/conf/nginx.conf
修改
#location ~ \.php$ {
  root          html;
#   fastcgi_pass  127.0.0.1:9000;
#   fastcgi_index  index.php;
#   fastcgi_param script_filename /scripts$fastcgi_script_name;
#   include       fastcgi_params;
#}

location ~ \.php$ {
   root          html;
   fastcgi_pass  127.0.0.1:9000;
   fastcgi_index  index.php;
   fastcgi_param script_filename /usr/local/nginx/html$fastcgi_script_name;
   include       fastcgi_params;
}
7、启动
shell>echo /usr/local/nginx/sbin/nginx >>/etc/rc.d/rc.local
收藏 分享邀请 转发到微博 举报

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

回顶部