wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql -with-mysql --disable-debug --disable-ipv6 --with-iconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --with-bz2 --with-pdo-mysql --enable-opcache=no --with-gd --enable-gd-native-ttf --with-libxml-dir=/usr --enable-xml --with-gettext --enable-bcmath
make && make install
cat /etc/init.d/php-fpm
#!/bin/bash
php_command=/usr/local/php/sbin/php-fpm
php_config=/usr/local/php/etc/php-fpm.conf
php_pid=/usr/local/php/var/run/php-fpm.pid
RETVAL=0
prog="php-fpm"
php_fpm_start() {
/usr/local/php/sbin/php-fpm
}
start(){
if [ -e $php_pid ]
then
echo "php-fpm already start..."
exit 1
fi
php_fpm_start
}
stop(){
if [ -e $php_pid ]
then
parent_pid=`cat $php_pid`
all_pid=`ps -ef | grep php-fpm | awk '{if('$parent_pid' == $3){print $2}}'`
for pid in $all_pid
do
kill $pid
done
kill $parent_pid
fi
exit 1
}
restart(){
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
service php-fpm start
chkconfig --add php-fpm
chkconfig php-fpm on