废话不多说,直接上步骤 1、修改PHP-fpm.conf配置文件 修改/usr/local/PHP/etc/PHP-fpm.conf(当然这个跟你配置的PHP路径相关)配置文件
启动pid=run/PHP-fpm.pid
启动error_log=log/PHP-fpm.log
pid file
pid="/usr/local/PHP/var/run/PHP-fpm.pid"
PHP-fpm path&file
PHPfpm="/usr/local/PHP/sbin/PHP-fpm"
param=$1
PHPnum=ps -ef | grep <a href="https://www.jb51.cc/tag/PHP/" target="_blank" class="keywords">PHP</a>-fpm | wc -l
if [ "$param" = "stop" ]; then
if [ "$PHPnum" = "1" ]; then
echo "PHP process does not exist."
exit 1
fi
kill cat $pid
echo "Close PHP processes. OK"
exit 1
fi
if [ "$param" = "start" ]; then
if [ "$PHPnum" != "1" ]; then
echo "PHP process exist."
exit 1
fi
$PHPfpm
echo "Open PHP processes. OK"
exit 1
fi
if [ "$param" = "restart" ]; then
if [ "$PHPnum" = "1" ]; then
echo "PHP process does not exist. Stop Failed."
else
kill cat $pid
for i in ps -ef | grep <a href="https://www.jb51.cc/tag/PHP/" target="_blank" class="keywords">PHP</a>-fpm | grep -v grep | awk {'print $2'}
do
kill -9 $i
echo "Kill $i successed."
done
echo "Close PHP processes. OK"
fi
$PHPfpm
if [ "$PHPnum" != "1" ]; then
echo "Open PHP processes. OK"
else
echo "Open PHP processes. Failed."
fi
exit 1
fi
3、修改权限
4、执行结果
原文链接:https://www.f2er.com/php/24058.html