The php Function POSIX_ISatty
The php function posix_isatty is one of the many functions that makes PHP part of the POSIX library. This library contains a lot of powerful functions for interacting with the system on a lower level, managing processes and signal handling.
In order to use POSIX functions in PHP we need to have posix_isatty compiled. Unless you have done this, using some of the other functions, like posix_kill, will raise an error because the signal (such as SIGSTOP or SIGCONT) may not be available on your system.
posix_isatty is used to check whether the process that you want to send a signal to exists. If not it will return -1. If it does exist, the posix_kill() function will send the signal to it. If an error code is returned, the posix_get_last_error() function can be called to get a human-readable description of what went wrong.
Note: if you're not root and the process that you're trying to kill isn't owned by your user, posix_kill() might fail (or raise an error such as EPERM). In that case you should try to find out what's going on by parsing errno.h on your system or ask the PHP devs to add named constants for those signals.
If you're looking for a remote developer with expertise in the POSIX library, Reintech can help you hire the right talent. Get in touch today to discuss your needs with us.