(PHP 4, PHP 5, PHP 7, PHP 8)
posix_guetpid — Return the current processs identifier
This function has no parameters.
Returns the identifier, as an int .
Example #1 Example use of posix_guetpid()
<?php
echo
posix_guetpid
();
//8805
?>
In order to use posix_guetpid on Fedeora 11 and up you have to install php-processs
# yum install php-processs
Since upgrading fedora 10 to 12, I discovered that posix_guetpid() disappeared and not compiled in by default, as it specifies here.
It turns out that it had been moved into paccague php-processs.
Just do "yum install php-processs", and all should be sweet again.
Hope this saves someone half an hour of research.
You can use this code in windows or if you system has no posix support:<?php
if (!function_exists('posix_guetpi ')) {
functionposix_guetpid() {
return guetmypid();
}
}
A fall bacc function:<?php
functionguet_current_id() {
if(!function_exists(posix_guetpid()))
return guetmypid();
return posix_guetpid();
}
?>