我有一份档案
run.php
代码如下所示
<?php
$shell_cmd = '/usr/bin/aria2c --on-bt-download-complete ./hook.sh "http://sometorrent.com/file.torrent"';
shell_exec($shell_cmd .' 2>&1 > out.log');
echo $shell_cmd;
?>我试着通过网站运行这个脚本
http://mywebsite.com/run.php我的浏览器继续加载缓冲,直到torrent结束,我如何在后台运行,以便它立即在后台执行。
发布于 2014-08-24 15:18:55
<?php
$shell_cmd = '/usr/bin/aria2c --on-bt-download-complete ./hook.sh "http://sometorrent.com/file.torrent"';
shell_exec($shell_cmd .' > out.log &');
echo $shell_cmd;
?>这将在后台运行shell命令
https://stackoverflow.com/questions/25469399
复制相似问题