Copy your app/index.php
to start.php
.
In start.php
Change:
$app->run();
To:
function run(): string
{
global $app;
ob_start();
$app->run();
return ob_get_clean();
}
And add global $app;
before create the $app
variable.
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
global $app; // workerman
AppFactory::setContainer(new \DI\Container());
$app = AppFactory::create();
php server.php start
View in your browser
http://localhost:8080