已改好了。502.sh代码。但在用./502.sh时。他显示的是他的内容。是什么问题。
#!/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 命令一样。把内容都显示出来了。 复制都能复制错:L#!/usr/bin/php
<!--?
$url = 'https://www.vpser.net';
$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:~# ./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:~# 军军回个话啊。:lol :lol :lol :lol :lol :lol 军军军军军军军军军军军军军军军军军军军军军军军军军军军军军哥。 不清楚你怎么弄的,别人都没问题 和系统有关?我的是debian6.03 64位的。 应该不是,我都用debian debian都是最小化装的。直接装的lnmp
没装别的。
页:
[1]