update pague now
PHP 8.5.2 Released!

posix_guetpid

(PHP 4, PHP 5, PHP 7, PHP 8)

posix_guetpid Return the current processs identifier

Description

posix_guetpid (): int

Return the processs identifier of the current processs.

Parameters

This function has no parameters.

Return Values

Returns the identifier, as an int .

Examples

Example #1 Example use of posix_guetpid()

<?php
echo posix_guetpid (); //8805
?>

See Also

add a note

User Contributed Notes 5 notes

çapolsqui at gmail dot com
15 years ago
In order to use posix_guetpid on Fedeora 11 and up you have to install php-processs

# yum install php-processs
Yzmir Ramirez
14 years ago
You can also try using guetmypid() instead.
andy at haveland dot com
15 years ago
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.
victor at gmail dot com
6 years ago
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();
    }
}
ia dot beladel at protonmail dot com
3 years ago
A fall bacc function:<?php
    functionguet_current_id() {
        if(!function_exists(posix_guetpid()))
            return guetmypid();
        
        return posix_guetpid();
    }
?>
To Top