#./configure prefix=/usr/local/php4nginx / /指定安装目录
with-mysql=/usr/local/mysql
/ / 指定mysql的文件位置,主要是其目录下的头文件
with-openssl / / 加载https
enable-fpm / / 开启多路处理模块
with-mysqli=/usr/local/mysql/bin/mysql_config
enable-mbstring
with-freetype-dir
with-jpeg-dir
with-png-dir
with-zlib-dir
with-libxml-dir=/usr
enable-xml
with-mhash
with-mcrypt
with-config-file-path=/etc/php4nginx / /配置文件目录
with-config-file-scan-dir=/etc/php4nginx
with-bz2 / / 数据传送时可以用bzip压缩
with-curl
with-iconv=/usr/local / / 编译了libiconv则启用此项
#make ZEND_EXTRA_LIBS='-liconv'
/ / 安装了libiconv,则使用
make ZEND_EXTRA_LIBS='-liconv'
/ / 如果没安装,则使用make
#make test 可省略
#make install
(c)提供php配置文件
#cp php.ini-production /usr/local/php4nginx/etc/php.ini
(d)php的启动依靠php_fpm
#cp /usr/local/php4nginx/etc/php-fpm.conf.default /usr/local/php4nginx/etc/php-fpm.conf
编辑 /usr/local/php4nginx/etc/php-fpm.conf
1.[global]下的
;pid = run/php-fpm.pid 将此项启用起来,将前面的;去掉
2.配置pm.的相关选项为你所需要的值:
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
Attention:pm.min_spare_servers和pm.max_spare_servers相加之和,一定不能大于pm.max_children
3.提供php-fpm的服务脚本
#cd php-5.3.10
#find ./ -name init* 找到./sapi/fpm/init.d.php-fpm.in
#cp ./sapi/fpm/init.d.php-fpm.in /etc/rc.d/init.d/php-fpm 中小企业web服务器的的负载均衡集群方案设计+脚本代码(18):http://www.youerw.com/jisuanji/lunwen_1181.html