而monitor赢了';t停止运行(php)
我正在使用while循环输出“.”,而服务器端脚本正在使用exec运行。这一点非常有效,因为它从未停止运行,也就是说,“……将继续建设到无限远 是否有人知道在客户端完成运行后进行更新的方法:而monitor赢了';t停止运行(php),php,while-loop,Php,While Loop,我正在使用while循环输出“.”,而服务器端脚本正在使用exec运行。这一点非常有效,因为它从未停止运行,也就是说,“……将继续建设到无限远 是否有人知道在客户端完成运行后进行更新的方法: $dbupdate = ($siteurl."/data_update.php"); $runupdate = exec("nohup curl ".$dbupdate." > /dev/null 2>&1 & echo $!"); while(exec("ps $runup
$dbupdate = ($siteurl."/data_update.php");
$runupdate = exec("nohup curl ".$dbupdate." > /dev/null 2>&1 & echo $!");
while(exec("ps $runupdate"))
{
echo(" . ");
ob_flush(); flush();
}
这是因为
while()
将继续执行,直到条件为false/null/0
,并且exec()
返回void。
文件:
像这样的东西可能有用吗
$runupdate = exec("nohup curl ".$dbupdate." > /dev/null 2>&1 & echo $!");
// Spitballing here...
$pid = true;
// Execute only while $op is strictly true, and not the PID that `echo $!` returns
while( $pid === true )
{
exec("ps $runupdate", $pid);
echo(" . ");
ob_flush(); flush();
}
查看此处的文档:如何将
$pid
更改为与true
不同的值?