I need obtain the PID of a process executed in PHP. A overview of my problem is the next:
I have a script wich execute two external programs (process in MatLab). The second programs must to wait the output of the first one and I need the PID of these process to kill them if the user wants it.
First I used exec() but I have any idea how get the pid. Also I have used proc_open() but I need that the first call blocks the script (the input for the second script will be stored in a temporal directory, is an image) until the first process ends.
My enviroment is in Windows. Thanks in advance.