1. Go to this page and download the library: Download takuya/php-daemonize-pcntl library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
takuya / php-daemonize-pcntl example snippets
kuya\PhpDaemonize\PhpDaemonize;
/**
* Daemonize function
*/
$m = new PhpDaemonize();
$m->start(function () { sleep(1000); });
$m->stop();
kuya\PhpDaemonize\PhpDaemonize;
/**
* Daemonize function
*/
$m = new PhpDaemonize();
$m->start(function () { pcntl_exec('/usr/bin/sleep',[10]) });