Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Send a signal to a process
<?php posix_kill(int $process_id, int $signal): bool
<?php $this->events->dispatch(new WorkerStopping($status, $options));
if (extension_loaded('posix')) {
posix_kill(getmypid(), SIGKILL);
}
exit($status);
<?php public function kill(int $processId, int $signal)
{
return posix_kill($processId, $signal);
}
}
<?php });
$this->loop->futureTick(function () {
posix_kill(posix_getpid(), SIGUSR1);
});
$this->loop->run();
<?php $this->loop->addSignal(SIGUSR1, $func);
$this->loop->addTimer(0.4, function () {
posix_kill(posix_getpid(), SIGUSR1);
});
$loop = $this->loop;
$this->loop->addTimer(0.9, function () use (&$func, $loop) {
<?php } else if ($childPid === 0) {
usleep(20000);
posix_kill($currentPid, constant($signal));
die();
}
}
<?php echo "PHP-FPM seems to be running already. This might be because Lambda stopped the bootstrap process but didn't leave us an opportunity to stop PHP-FPM (did Lambda timeout?). Stopping PHP-FPM now to restart from a blank slate.\n";
$result = posix_kill($pid, self::SIGTERM);
if ($result === false) {
echo "PHP-FPM's PID file contained a PID that doesn't exist, assuming PHP-FPM isn't running.\n";
unlink(self::SOCKET);