sam2222 Posted March 20, 2006 Share Posted March 20, 2006 Hello,Is there a way to make PHP not wait for a process to finish when you start it from exec? or is there any other ways to start a process from PHP and for PHP not to wait?Thanks,Sam Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 20, 2006 Share Posted March 20, 2006 Can you explain why you want this to happen?Ken Quote Link to comment Share on other sites More sharing options...
sam2222 Posted March 20, 2006 Author Share Posted March 20, 2006 Thanks for your reply.Well I want the process to run in the background and do somethings that will take a while and I don't want the script to be loading for all the time. I've got the process to run in the background now I just can't get PHP to stop waiting for it to finish.Thanks,Sam Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 20, 2006 Share Posted March 20, 2006 You could look at the [a href=\"http://www.php.net/pcntl_fork\" target=\"_blank\"]pcntl_fork[/a]() function and do the exec in the forked procedure. That script would wait for the execed procedure to finish before ending. You main script would have to wait until the forked script finishes before ending, but that could be at the very end of the script.I've never used this myself, so YMMV.Ken Quote Link to comment Share on other sites More sharing options...
sam2222 Posted March 20, 2006 Author Share Posted March 20, 2006 Thanks! I will have a look at that.Thanks,Sam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.