发布于 2016-02-12 21:03:50 | 122 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

php-fpm FastCGI 进程管理器

PHP-FPM 是 一个 PHP FastCGI 进程管理器


这篇文章主要介绍了php-fpm可执行文件出现乱码的解决方法,需要的朋友可以参考下

配置php-fpm

默认php安装目录:/usr/local/php
先拷贝配置文件,在进行编辑


cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
vi/usr/local/php/etc/php-fpm.conf

制作fpm启动服务

复制下面的代码,vi/etc/init.d/php-fpm,保存


#!/bin/bash
#php-fpmStartupscriptforphp-fpm,aFastCGIimplementation
#thisscriptwascreatedbytonyat2010.07.21,basedonjackbillow'snginxscript.
#itisv.0.0.1version.
#ifyoufindanyerrorsonthisscripts,pleasecontacttony.
#bysendingmailtotonytzhouatgmaildotcom.
#
#chkconfig:-8515
#description:php-fpmisanalternativeFastCGIimplementation,withsomeadditionalfeaturesusefulforsitesofanysize,especiallybusiersites.
#
#processname:phpfpm
#pidfile:/usr/local/php/var/run/phpfpm.pid
#config:/usr/local/php/etc/phpfpm.conf

phpfpm=/usr/local/php/sbin/php-fpm
config=/usr/local/php/lib/php.ini
pid=/usr/local/php/var/run/php-fpm.pid

RETVAL=0
prog="phpfpm"

#Sourcefunctionlibrary.
./etc/rc.d/init.d/functions

#Sourcenetworkingconfiguration.
./etc/sysconfig/network

#Checkthatnetworkingisup.
[${NETWORKING}="no"]&&exit0

[-x$phpfpm]||exit0

#Startphpfpmdaemonsfunctions.
start(){

if[-e$pid];then
echo"phpfpmisalreadyrunning...."
exit1
fi

echo-n$"Starting$prog:"
daemon$phpfpm-c${config}
RETVAL=$?
echo
[$RETVAL=0]&&touch/var/lock/subsys/phpfpm
return$RETVAL

}

#Stopphpfpmdaemonsfunctions.
stop(){
echo-n$"Stopping$prog:"
killproc$phpfpm
RETVAL=$?
echo
[$RETVAL=0]&&rm-f/var/lock/subsys/phpfpm/var/run/phpfpm.pid
}

#reloadphpfpmservicefunctions.
reload(){

echo-n$"Reloading$prog:"
#kill-HUP`cat${pid}`
killproc$phpfpm-HUP
RETVAL=$?
echo

}

#Seehowwewerecalled.
case"$1"in
start)
start
;;

stop)
stop
;;

reload)
reload
;;

restart)
stop
start
;;

status)
status$prog
RETVAL=$?

*)
echo$"Usage:$prog{start|stop|restart|reload|status|help}"
exit1
esac

exit$RETVAL

chmod+x/etc/rc.d/init.d/php-fpm#添加执行权限
chkconfigphp-fpmon#设置开机启动

启动/etc/init.d/php-fpmstart
停止/etc/init.d/php-fpmstop
重启/etc/init.d/php-fpmrestart



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务