By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,549 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,549 IT Pros & Developers. It's quick & easy.

How to execute a script in background using exec() from php script

P: 13
Hi All,
I have to run a shell script from my php script and while shell script is running I have to do some other tasks in my php script.To run the shell script I am using
exec("sh &");
The Next line in my php script got executed after the shell script completes its execution. I want the next line of my script got eecuted as soon as i start shell script.
Please suggest me how can I run the shell script in background so that as soon as the shell script starts the exec command comes out.
Jan 24 '08 #1
Share this Question
Share on Google+
1 Reply

code green
Expert 100+
P: 1,726
I think you need to use passthru() instead of exec()
Jan 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.