nginx小总结(五)
nginx小总结(四)
http://www.zhishiwu.com/os/201303/192406.html
nginx连接php www.zhishiwu.com
nginx本身只支持静态的文本,当处理动态网页的时候,则需要借助于其他模块(插件),比如动态的php,就需要fast-CGI模块,fast-CGI去连接php-fpm,首先,我们得编译安装php
[root@host2 ~]# rpm -qa php 如果之前安装过,需要卸载掉重新安装!
gcc make等都是要按装的
tar zxf libiconv-1.13.1.tar.gz #加强系统对支持字符编码转换的功能 www.zhishiwu.com
cd libiconv-1.13.1/
./configure --libdir=/usr/local/lib64
make && make install
tar jxf libmcrypt-2.5.8.tar.bz2 # mcrypt mhash是php加密算法扩展库
cd libmcrypt-2.5.8
./configure –libdir=/usr/local/lib64
make && make install
cd libltdl
./configure --libdir=/usr/local/lib64 --enable-ltdl-install
make && make install
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure --libdir=/usr/local/lib64
make && make install
[root@host2 mhash-0.9.9.9]# vim /etc/ld.so.conf 在里面添加
include /usr/local/lib64
ldconfig /usr/local/lib64 让系统重新加载lib库,必须有
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure --libdir=/usr/local/lib64
make && make install
yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-
devel gmp-devel openldap-devel -y
php的准备工作已经OK!
useradd -M -s /sbin/nologin www
tar jxf php-5.3.6.tar.bz2cd php-5.3.6
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir--with-freetype-dir --without-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64 --with-ldap --with-ldap-sasl --with-
mcrypt --with-mhash
各种参数、重点是--enable-fpm,还有,那个mysql现在我们是没有安装的可以去掉,在实际中,还是应该先安装mysql!
make ZEND_EXTRA_LIBS='-liconv'
make install
wget http://pear.php.net/go-pear.phar
/usr/local/webserver/php/bin/php go-pear.phar