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