A very common reason is a wrong site baseUrl configuration.\n Current configured baseUrl = / (default value)\n We suggest trying baseUrl = \n\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",function(){void 0===window.docusaurus&&insertBanner()})
Application server and process manager for modern PHP applications.
Powered by the Revolt event loop and built on the AMPHP ecosystem, it brings true asynchronous capabilities to PHP applications.
With its extensible plugin system, PHPStreamServer can replace traditional stacks such as Nginx, PHP-FPM, Cron, and Supervisor.Features
Quick Start
$ composer require phpstreamserver/http-server$ php server.php startuse Amp\Http\Server\HttpErrorException;
use Amp\Http\Server\Request;
use Amp\Http\Server\Response;
use PHPStreamServer\Core\Server;
use PHPStreamServer\Plugin\HttpServer\HttpServerPlugin;
use PHPStreamServer\Plugin\HttpServer\Worker\HttpServerProcess;
$server = new Server();
$server->addPlugin(
new HttpServerPlugin(), // Register the HTTP server plugin
);
$server->addWorker(
new HttpServerProcess(
listen: '0.0.0.0:8080', // Address to listen on
count: 2, // Number of worker processes
onRequest: static function (Request $request): Response {
return match ($request->getUri()->getPath()) {
'/' => new Response(body: 'Hello world'),
default => throw new HttpErrorException(404),
};
}
),
);
exit($server->run());