Execute a program from PHP and continue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dmcewan
Forum Newbie
Posts: 3
Joined: Thu Feb 09, 2006 3:58 pm

Execute a program from PHP and continue

Post 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
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

fork() ?
There are 10 types of people in this world, those who understand binary and those who don't
programmingjeff
Forum Commoner
Posts: 26
Joined: Fri Jan 05, 2007 10:56 am

Post by programmingjeff »

Execute the program in the background.

Code: Select all

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