VPS侦探论坛

 找回密码
 注册
查看: 8174|回复: 11

已改好了。502.sh代码。但在用./502.sh时。他显示的是他的内容。是什么问题。

[复制链接]
发表于 2012-7-29 07:08:56 | 显示全部楼层 |阅读模式

#!/usr/bin/php
<!--?
$url = 'https://www.vpser.net';
$cmd = '/usr/local/php/sbin/php-fpm restart';

for($i = 0; $i < 5; $i ++){
$exec = "curl --connect-timeout 3 -I $url 2>/dev/null";
$res = shell_exec($exec);

if(stripos($res,'502 Bad Gateway') !== false){
shell_exec($cmd);
exit();
}
}
?>


https://www.vpser.net这里已改成自已的了。。。文件放在了/root/502.sh 我在用./502.sh时。他就像用cat 命令一样。把内容都显示出来了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-7-29 11:05:14 | 显示全部楼层


复制都能复制错
  1. #!/usr/bin/php
  2. <!--?
  3. $url = 'https://www.vpser.net';
  4. $cmd = '/etc/init.d/php-fpm restart';

  5. for($i = 0; $i < 5; $i ++){
  6. $exec = "curl --connect-timeout 3 -I $url 2>/dev/null";
  7. $res = shell_exec($exec);

  8. if(stripos($res,'502 Bad Gateway') !== false){
  9. shell_exec($cmd);
  10. exit();
  11. }
  12. }
  13. ?>
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-7-30 09:14:35 | 显示全部楼层

晕。。。哪里有错。给个正确的。谢谢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-7-30 11:51:56 | 显示全部楼层



看我发的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-7-31 07:27:20 | 显示全部楼层

我用虑拟机测的。网址改为虚拟机的地址。用的新的代码。还是一样。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2012-7-31 07:28:30 | 显示全部楼层

root@debian:~# ./502.sh
<!--?
$url = 'http://192.168.1.58';
$cmd = '/etc/init.d/php-fpm restart';

for($i = 0; $i < 5; $i ++){
$exec = "curl --connect-timeout 3 -I $url 2>/dev/null";
$res = shell_exec($exec);

if(stripos($res,'502 Bad Gateway') !== false){
shell_exec($cmd);
exit();
}
}
?>
root@debian:~#
 楼主| 发表于 2012-8-3 09:43:06 | 显示全部楼层

军军回个话啊。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-8-4 17:46:37 | 显示全部楼层

军军军军军军军军军军军军军军军军军军军军军军军军军军军军军哥。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-8-5 09:08:27 | 显示全部楼层

不清楚你怎么弄的,别人都没问题

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2012-8-6 07:43:08 | 显示全部楼层



和系统有关?我的是debian6.03 64位的。
发表于 2012-8-6 19:46:20 | 显示全部楼层

应该不是,我都用debian
 楼主| 发表于 2012-8-7 20:35:10 | 显示全部楼层

debian都是最小化装的。直接装的lnmp
没装别的。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 15:32 , Processed in 0.027937 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表