0

I had a file

run.php

the code is as followed

<?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;
?>

I tried run this script via website which is

http://mywebsite.com/run.php

My browser continue loading buffering sort of, until the torrent finish, how do i run in background so it execute right away in background.

0

1 Answer 1

1
<?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;
?>

This will run the shell command in background

Sign up to request clarification or add additional context in comments.

1 Comment

I tried your solution but my program still run with buffering till the script execute finish.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.