My environment: Ubuntu 18.04 LTS PHP 7.2.2 ZTS no-debug
I have a big application where sometimes Broken pipe
error is happening.
I want to handle it but for this I need to simulate this error for development. How can I do that ?
I have tried:
posix_kill(posix_getpid(), SIGPIPE);
while(1) {
sleep(5);
}
Also:
sudo kill -13 pid
But script keep working.
Expected result:
Thread 1 "php" received signal SIGPIPE, Broken pipe.
and script should get stopped.