Page 1 of 1

Execute a program from PHP and continue

Posted: Sun Aug 05, 2007 3:47 pm
by dmcewan
Hi,

I'm trying to get a php script to execute a program on the server, which it does fine with exec or system, but it always waits for the program to return (i.e. exit) before it executes the rest of the php script. Is there a way to execute a program and then just continue? I really don't care what the program output is.

Thanks in advance for even reading this post!

== David

Posted: Sun Aug 05, 2007 4:43 pm
by VladSun
fork() ?

Posted: Sun Aug 05, 2007 10:00 pm
by programmingjeff
Execute the program in the background.

Code: Select all

exec("application_name > /dev/null 2>&1 &");