php重启nginx脚本
来源:网络 责任编辑:admin 发表时间:2013-07-01 12:19 点击:次
	   
	
	重启nginx是执行 /usr/bin/nginxd restart 即可
	以下是脚本内容:
	#!/usr/local/php/bin/php
	<?
	if($argv[1]=="start")
	{
	echo system("ulimit -SHn 51200");
	echo system("/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf");
	}
	elseif($argv[1]=="stop")
	{
	echo system("killall -9 nginx");
	}
	elseif($argv[1]=="test")
	{
	echo system("/usr/local/nginx/sbin/nginx -t");
	}
	elseif($argv[1]=="restart")
	{
	echo system("killall -9 nginx");
	sleep(1);
	echo system("ulimit -SHn 51200");
	echo system("/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf");
	}
	else
	        echo "Usage: nginx {start|stop|restart|test|}\r\n";
	?>
作者“稀饭吃了不顶饿”
相关新闻>>
- 发表评论
- 
				
- 最新评论 进入详细评论页>>







