|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70708 Call to undefined function pcntl_sigwaitinfo
Submitted: 2015-10-13 13:10 UTC Modified: 2020-03-19 11:13 UTC
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: damien dot lasserre at gmail dot com Assigned:
Status: Verified Package: PCNTL related
PHP Version: 7.0Git-2015-10-13 (Git) OS: OS X 10.10.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: damien dot lasserre at gmail dot com
New email:
PHP Version: OS:


 [2015-10-13 13:10 UTC] damien dot lasserre at gmail dot com
From manual page:

When i try to use pcntl_sigwaitinfo function, an error occur :

Uncaught Error: Call to undefined function pcntl_sigwaitinfo, but pcntl extension was installed and activated...

while($running) {
    /** @var int $pid */
    $pid = pcntl_waitpid(-1, $status, WNOHANG);

    if($pid) {
        $sig = pcntl_wstopsig($status);
        if($sig === SIGUSR1) {
    /** Restart all services if SIGHUP send as SMP process */
    pcntl_sigwaitinfo(array(SIGUSR1), $info);
    if((int)$info['signo'] === SIGUSR1) {

Below: (php -i | grep pcntl)
pcntl support => enabled
OLDPWD => /tmp/php-src/ext/pcntl
$_SERVER['OLDPWD'] => /tmp/php-src/ext/pcntl



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-13 14:06 UTC] damien dot lasserre at gmail dot com
I think the methode doesn't work on MAC :( but after configuration with support pcntl if i check the file main/php_config.h :

/* Define to 1 if you have the `sigtimedwait' function. */

/* Define to 1 if you have the `sigwaitinfo' function. */

 [2016-06-18 02:28 UTC] dave at mudsite dot com
Correct.  Darwin appears not to implement sigwaitinfo() or sigtimedwait():

However, on my macos machine I can accomplish what you're trying to do, possibly by doing this:

class Foo {            
  function signaltest() {
    pcntl_signal(SIGUSR1, array($this, 'restart'));
  function restart($signo) {
    print_r("Restarting From $signo");
$f = new Foo();        
posix_kill(posix_getpid(), (int)SIGUSR1);
 [2020-03-19 11:13 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2020-03-19 11:13 UTC]
Indeed, this function is defined conditionally, and that should be
documented.  See also
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 07:01:27 2023 UTC