|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-08-14 02:01 UTC] abolfazl dot ziaratban at gmail dot com
Description:
------------
Hi
PHP hangs when I open php with proc_open and send a signal.
Test script:
---------------
test2.php
echo 'Test'; #does not run
test1.php
$proc = proc_open('php test2.php',[],$_);
posix_kill(proc_get_status($proc)['pid'],SIGUSR1);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 07:00:02 2025 UTC |
fix bug : $proc = proc_open('php test2.php',[],$_); sleep(1); #fix posix_kill(proc_get_status($proc)['pid'],SIGUSR1);The main problem is : test2.php does not run when sending SIGUSR1. > because the SIGUSR1 default action is to terminate the process Why? SIGUSR1 and SIGUSR2 are User-defined signals. I thought these signals were for me. Why the php using this signals for terminate the process? Ok i put assume that signals are for terminate the process but why does the SIGALRM signal behave similarly(acts like SIGUSR1)? New Example : test1.php $proc = proc_open('php /root/test2.php',[],$p); posix_kill(proc_get_status($proc)['pid'],SIGALRM); while(proc_get_status($proc)['running']) sleep(1); echo "End !"; test2.php mkdir('/root/a'); In this example, directory `a` is not created and test2.php does not actually run.