user198729
user198729

Reputation: 63636

How to get PID of a background process in PHP?

php file.php &

How to get PID of the background process in file.php?

Upvotes: 2

Views: 5833

Answers (2)

Emil Ivanov
Emil Ivanov

Reputation: 37633

getmypid() does what you need.

Upvotes: 1

Josh
Josh

Reputation: 11070

I believe you're looking for the function getmypid()

http://php.net/manual/en/function.getmypid.php

posix_getpid() seems to do the same thing...

http://php.net/manual/en/function.posix-getpid.php

Upvotes: 2

Related Questions