-1

I Want To Call shell_exec() Without Waiting For The Output

I Want to Execute Another php/or bash script on the background without affect the current page I've Tested Those:

'alert' > k& 
> /dev/null &
& disown

And I Tested Many Others That posted here but still same thing

My Php/Bash script will execute a command to another server and it will take a while .

NoOne
  • 1
  • 1

1 Answers1

0

try this: exec('nohup '.$command.' > ' . $outfile . ' 2>&1 & echo $!');

Moshe Dolev
  • 194
  • 2
  • 4
  • I tested this also , same thing i guess there is something wrong with other files that i want to run it on background , please if anyone can connect to my PC through Teamviewer and help me i will appreciate it! – NoOne May 19 '20 at 19:13