Terminate exec() Program

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
ashrust
Forum Newbie
Posts: 5
Joined: Sun Apr 30, 2006 6:52 am

Terminate exec() Program

Post by ashrust »

Hi,

I am running a lot of scripts concurrently for a real time application. I am using the exec() function to do this.

Is there a way of knowing when these programs are finished operating and how can I terminate them, once they have begun?

thanks in advance.

ash
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

take a look at proc_* functions
ashrust
Forum Newbie
Posts: 5
Joined: Sun Apr 30, 2006 6:52 am

Post by ashrust »

does proc_open execute the command in the same way exec does. in the manual, it appears to suggest exe executes programs in a different manner.

Also can a program opened with proc_open terminate itself? If so how?

thanks

ash
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ashrust wrote:does proc_open execute the command in the same way exec does. in the manual, it appears to suggest exe executes programs in a different manner.

Also can a program opened with proc_open terminate itself? If so how?

thanks

ash
You can get the PID with those functions, and as thus, you can call `kill' to terminate them. You can also form pipes to keep in contact with a process once it has been started.
Post Reply