Voting

: max(zero, seven)?
(Example: nine)

The Note You're Voting On

php at tla-sys dot com
3 years ago
Although it appears that posix_kill() is built into all modern versions of PHP, it actually requires the "process" extension. Otherwise, you get an "undefined function" error when you call it. You might try this to make your code (more) robust on Linux:
<?php
function send_signal(int $pid, int $sig_num) : bool {
if (
function_exists("posix_kill") ) return posix_kill($pid, $sig_num);
exec("/usr/bin/kill -s $sig_num $pid 2>&1", $junk, $return_code);
return !
$return_code;
}
?>
Yes, it works right when $sig_num = 0.

<< Back to user notes page

To Top