91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

php5.2+php5.4 啟動關閉腳本整合

發布時間:2020-07-08 09:33:05 來源:網絡 閱讀:875 作者:wwdhks 欄目:web開發

php5.2 啟動和關閉腳本直接copy /usr/local/php/sbin/php-fpm 到 /etc/init.d/目錄下就行了

php5.4 啟動和關閉腳本直接copy  cp -f /tools/php-5.3.6/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 到 /etc/init.d/目錄下就行了

將2者合并之后為:

#! /bin/sh

prefix=/usr/local/php

exec_prefix=${prefix}


php_fpm_CONF=${prefix}/etc/php-fpm.conf


phpver=$(${prefix}/bin/php -v|head -1|awk '{print $2}'|awk -F"." '{print $1"."$2}')

if [[ $phpver == '5.2' ]];then

php_fpm_PID=${prefix}/logs/php-fpm.pid

php_fpm_BIN=${prefix}/bin/php-cgi

php_opts="--fpm-config $php_fpm_CONF"

else

php_fpm_PID=${prefix}/var/run/php-fpm.pid

php_fpm_BIN=${exec_prefix}/sbin/php-fpm

php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"

fi


wait_for_pid () {

try=0


while test $try -lt 35 ; do


case "$1" in

'created')

if [ -f "$2" ] ; then

try=''

break

fi

;;


'removed')

if [ ! -f "$2" ] ; then

try=''

break

fi

;;

esac


echo -n .

try=`expr $try + 1`

sleep 1


done


}



case "$1" in

start)

echo -n "Starting php_fpm "

if [[ $phpver == '5.2' ]];then

$php_fpm_BIN --fpm $php_opts

else

$php_fpm_BIN --daemonize $php_opts

fi


if [ "$?" != 0 ] ; then

echo " failed"

exit 1

fi


wait_for_pid created $php_fpm_PID


if [ -n "$try" ] ; then

echo " failed"

exit 1

else

echo " done"

fi

;;


stop)

if [[ $phpver == '5.2' ]];then

echo -n "Shutting down php_fpm "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -TERM `cat $php_fpm_PID`


wait_for_pid removed $php_fpm_PID


if [ -n "$try" ] ; then

echo " failed"

exit 1

else

echo " done"

fi

else

echo -n "Gracefully shutting down php-fpm "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -QUIT `cat $php_fpm_PID`


wait_for_pid removed $php_fpm_PID


if [ -n "$try" ] ; then

echo " failed. Use force-quit"

exit 1

else

echo " done"

fi

fi

;;


quit)

echo -n "Gracefully shutting down php_fpm "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -QUIT `cat $php_fpm_PID`


wait_for_pid removed $php_fpm_PID


if [ -n "$try" ] ; then

echo " failed"

exit 1

else

echo " done"

fi

;;

force-quit)

echo -n "Terminating php-fpm "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -TERM `cat $php_fpm_PID`


wait_for_pid removed $php_fpm_PID


if [ -n "$try" ] ; then

echo " failed"

exit 1

else

echo " done"

fi

;;



restart)

$0 stop

$0 start

;;


reload)


echo -n "Reload service php-fpm "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -USR2 `cat $php_fpm_PID`


echo " done"

;;

logrotate)


echo -n "Re-opening php-fpm log file "


if [ ! -r $php_fpm_PID ] ; then

echo "warning, no pid file found - php-fpm is not running ?"

exit 1

fi


kill -USR1 `cat $php_fpm_PID`


echo " done"

;;

status)

if [ ! -r $php_fpm_PID ] ; then

echo "php-fpm is stopped"

exit 0

fi


PID=`cat $php_fpm_PID`

if ps -p $PID | grep -q $PID; then

echo "php-fpm (pid $PID) is running..."

else

echo "php-fpm dead but pid file exists"

fi

;;

*)

if [[ $phpver == '5.2' ]];then

echo "Usage: $0 {start|stop|quit|restart|reload|logrotate}"

exit 1

else

echo "Usage: $0 {start|stop|force-quit|restart|reload|status}"

exit 1

fi

;;


esac





向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

肥城市| 武平县| 浙江省| 姚安县| 永嘉县| 宣恩县| 界首市| 扶风县| 剑阁县| 邵武市| 抚宁县| 江安县| 青阳县| 深水埗区| 丘北县| 常熟市| 紫阳县| 吉水县| 靖州| 梅河口市| 金塔县| 张北县| 兴化市| 嵊泗县| 通海县| 延川县| 高碑店市| 敖汉旗| 四子王旗| 洮南市| 临湘市| 英德市| 宜昌市| 汝南县| 平原县| 大宁县| 镇巴县| 太康县| 阳曲县| 鹤庆县| 陈巴尔虎旗|