编译安装php-fpm 重启脚本
#!/bin/bashpid="/opt/php7/var/run/php-fpm.pid"ini="/opt/php7/etc/php.ini"conf="/opt/php7/etc/php-fpm.conf"if[-f/opt/php7/var/run/php-fpm.pid];thenecho"pidexists"fiif[-f/opt/php7/etc/php.ini];thenecho"inifileexists"fiif[-f/opt/php7/etc/php-fpm.conf];thenecho"php-fpmconfigurefileexists"fiecho$1case$1instart)if[-f$pid];thenecho"Processalreadyexists."else/opt/php7/sbin/php-fpm-c$ini-y$confif(($?==0));thenecho"Startphp-fpmsuccess"elseecho"Startfaild......"fifi;;stop)if[-f$pid];thenecho"Stopphp-fpmprocess"kill$(cat$pid)if(($?==0));thenecho"Stopphp-fpmover."elseecho"Stopphp-fpmfaild..."fielseecho"Checkprocessexists?"fi;;restart)if[-f$pid];thenkill$(cat$pid)if(($?==0));thenecho"Stopphp-fpmover"/opt/php7/sbin/php-fpm-c$ini-y$confif(($?==0));thenecho"Startphp-fpmover"elseecho"Startfaild"fielseecho"Stopfaild"fielse/opt/php7/sbin/php-fpm-c$ini-y$confif(($?==0));thenecho"Startphp-fpmover"elseecho"Starfaild"fifi;;*)echo"Usage:php.sh(start|stop|restart)"esac
readme:
保存为shell脚本文件,直接运行,会提示使用方法,根据安装环境,修改pid ini conf 等文件路径。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。