PHP 7.1.0 Released

posix_getppid

(PHP 4, PHP 5, PHP 7)

posix_getppidRetourne l'identifiant du processus parent

Description

int posix_getppid ( void )

Retourne l'identifiant du processus parent du processus courant.

Valeurs de retour

Retourne l'identifiant, sous la forme d'un entier.

Exemples

Exemple #1 Exemple avec posix_getppid()

<?php
echo posix_getppid(); //8259
?>

add a note add a note

User Contributed Notes 1 note

up
0
divinity76 at gmail dot com
1 month ago
WARNING, when using proc_open, your child will NOT get the parent php process's PID by using posix_getppid() , it will actually get the pid of a shell ( /bin/sh ? ) started by php, which in turn starts the child.  i don't currently have a good workaround for this, but i'm working around it by having the parent write it's pid to a file and having the chidren read the file
To Top