1
我想监视我在Web服务器上运行的程序。 我可以绘制进度条,还是只显示我的代码返回的百分比? php脚本产生具有参数的外部代码。显示计算进度的方法是什么?
$Status="rendering...";
$cmd = "cd $rpath && $envopts /home/arm2arm/bin/sph2grid";
$shellcmd=$cmd.$params.'| tee sph2grid.log ';
echo '<strong>'.$shellcmd.'</strong>';
$tmp=shell_exec($shellcmd);
那么毕竟我显示日志文件:
<?php
function ViewLog() {
$string = file_get_contents('../../PHP-Login/tmp/sph2grid.log');
$string = str_replace("\n", '<br>', $string);
echo $string;
}
?>
我可以绑定我的应用程序的输出一些"<div>"
?
在此先感谢。
Arman。
的百分比不幸的是这里最难的部分是你放什么percentComplete.php文件 – 2010-04-19 13:11:54
好,这取决于正在记录什么。 PHP文件可以解析日志并获取该信息。 – Luis 2010-04-19 13:29:47
感谢您的解决方案。有没有办法停止计时器?我应该把计时器放到无穷远处来阻止它吗? – Arman 2010-04-19 21:11:25