简体   繁体   English

PHP while 循环在发送后中断

[英]PHP while loop break after sent

I sent a PHP infinite loop and I can't stop it, I deleted the file on the server but it still continues to enter data into the DATABASE, is there any way to deactivate it?我发送了一个PHP无限循环,我无法阻止它,我删除了服务器上的文件,但它仍然继续将数据输入到数据库中,有什么办法可以停用它吗?

$q = "INSERT INTO `gancxadebebi` 
($keys) 

VALUES 

($values)";
$var = 0;
while(true){
    sleep(1);
    $r = mysqli_query($c, $q);
    if($r){
        echo 'success';
    }else{
        echo 'error';
    }
    ++$var;
    echo $var;
    
    if($var == '100000'){
        break;
    }
    
}

I'm guessing this is a development machine.我猜这是一个开发机器。 If that is the case, just restart the web-server to terminate the PHP script.如果是这种情况,只需重新启动 Web 服务器以终止 PHP 脚本。 If you are using apache, that would look like:如果您使用的是 apache,则如下所示:

sudo apache2ctl restart

Don't run this command when you are working in a production machine.在生产机器上工作时不要运行此命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM