pcntl_alarm(int $seconds) only has a resolution of seconds. Is there a way in PHP to signal a SIGALRM with a delay of, say, milliseconds? Maybe a posix_kill() with a delay argument? PS.: I’m aware of SwooleProcess::alarm() from the PECL extension Swoole, but I’m looking for a more bare-bones PHP solution. Answer I found one way to do it, but it
Tag: signals
Bash trap command failing to catch fatal php script exit code 255
Minimal example of the issue: #!/bin/bash errHandler() { echo “Something went wrong. Exiting now.” exit 1 } trap ‘errHandler’ ERR INT pi_process () { bin/pi $@ echo $? } pi_process …