#cd /usr/local/src //进入src目录
#wget http://cn2.php.net/distributions/php-5.6.30.tar.gz //下载
#tar zxf php-5.6.30.tar.gz //解压缩
#cd php-5.6.30/ //进入php的目录
#./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
#make&&make install
#/usr/local/php-fpm/sbin/php-fpm -m //查看模块
#/usr/local/php-fpm/sbin/php-fpm -i
#/usr/local/php-fpm/sbin/php-fpm -t //检查语法错误
#cp php.ini-production /usr/local/php-fpm/etc/php.ini //拷贝php的配置文件(适合生产环境)
#vim /usr/local/php-fpm/etc/php-fpm.conf //编辑php-fpm服务的配置文件内容
[global] //定义全局参数
pid = /usr/local/php-fpm/var/run/php-fpm.pid //定义它的pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www] //模块名
listen = /tmp/php-fcgi.sock //监听
#listen = 127.0.0.1:9000 //监听本机ip和端口
listen.mode = 666 //监听权限,只有监听socket时才会生效
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
#cp sapi /fpm/init.d.php-fpm /etc/init.d/php-fpm //拷贝启动脚本
#chmod 755 /etc/init.d/php-fpm //设置权限
#chkconfig --add php-fpm //添加启动项
#chkconfig php-fpm on //设置开机启动
#service php-fpm start //启动php-fpm