1. Go to this page and download the library: Download phpstreamserver/core 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/ */
phpstreamserver / core example snippets
// server.php
use PHPStreamServer\Core\Server;
use PHPStreamServer\Core\Worker\ExternalProcess;
use PHPStreamServer\Core\Worker\WorkerProcess;
$server = new Server();
$server->addWorker(
new WorkerProcess(
name: 'Supervised Program',
count: 1,
onStart: function (WorkerProcess $worker): void {
// custom long running process
},
),
new ExternalProcess(
name: 'External supervised program',
count: 1,
command: 'sleep 600'
),
);
exit($server->run());
bash
$ php server.php start
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.