Answer the question
In order to leave comments, you need to log in
Slim 4 and Error?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
AllowOverride All
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
require __DIR__ . '/vendor/autoload.php';
$app = AppFactory::create();
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
$name = $args['name'];
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
[26-Sep-2020 19:04:54 Europe/Kiev] PHP Fatal error: Uncaught RuntimeException: Could not detect any PSR-17 ResponseFactory implementations. Please install a supported implementation in order to use `AppFactory::create()`. See https://github.com/slimphp/Slim/blob/4.x/README.md for a list of supported implementations. in /home/tsecret1/API/vendor/slim/slim/Slim/Factory/AppFactory.php:167
Stack trace:
#0 /home/tsecret1/API/vendor/slim/slim/Slim/Factory/AppFactory.php(93): Slim\Factory\AppFactory::determineResponseFactory()
#1 /home/tsecret1/API/index.php(8): Slim\Factory\AppFactory::create()
#2 {main}
thrown in /home/tsecret1/API/vendor/slim/slim/Slim/Factory/AppFactory.php on line 167
Answer the question
In order to leave comments, you need to log in
Could not detect any PSR-17 ResponseFactory implementations. Please install a supported implementation in order to use `AppFactory::create()`. See https://github.com/slimphp/Slim/blob/4.x/README.md for a list of supported implementations.
composer require slim/psr7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question