首页 电脑 电脑学堂 查看内容

php重启nginx脚本

2011-9-15 21:31 718 0

摘要:   重启nginx是执行 /usr/bin/nginxd restart 即可  以下是脚本内容:  #!/usr/local/php/bin/php  <?  if($argv[1]=="st...
关键词: 脚本 php bin usr 以下 restart 内容 nginxd local nginx

  重启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|} ";  ?>
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部