views:

67

answers:

1

I have always used:

$pid = exec("/usr/local/bin/php file.php $args > /dev/null & echo \$!");

But I am using an XP virtual machine to develop a web app and I have no idea how to get the pid in windows.

I tried this on a cmd:

C:\\wamp\\bin\\php\\php5.2.9-2\\php.exe "file.php args" > NUL & echo $!

And it gets the file executed, but the output is "$!"

How can I get the pid into the var $pid? (using php)

A: 

You will have to install an extra extension, but found the solution located at Uniformserver's Wiki.

UPDATE

After some searching you might look into tasklist which coincidently, you may be able to use with the PHP exec command to get what you are after.

Brad F Jacobs
Thanks, anyway I think I will just setup a server on a linux virtual box, I just dont like having a webserver on my main OS and the only one I had was on win.
jarkam
Updated, found a program that is built into xp called `tasklist` which may do what you want.
Brad F Jacobs