Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

shell_exec without waiting for the output [duplicate]

Tags:

php

Possible Duplicate:
Asynchronous shell exec in PHP
Is there a way to use shell_exec without waiting for the command to complete?

I want to run a quite slow / complex program which takes at least 10 minutes to complete. I want to call this via shell_exec or something similar, but I dont want the php script to wait for the completion of this program.

is thing something I can do? and if so how can I do that?

like image 428
nivanka Avatar asked May 26 '11 14:05

nivanka


1 Answers

This has been answered before at Asynchronous shell exec in PHP

Briefly:

shell_exec( $your_command . "> /dev/null 2>/dev/null &" );
like image 79
Mat Avatar answered Oct 20 '22 07:10

Mat