EN

Copying sources and texts (also in parts) for publishing without our permission is NOT ALLOWED. We are fed up with finding our work on other sites (like stackoverflow).

Copying for private and non-public usage is allowed.

DE

Das Kopieren von Quellcode und Texten (auch in Auszügen) ist nicht erlaubt. Wir haben es gründlich satt, unsere Arbeit auf anderen Webseiten zu finden.

Das private Kopieren und Benutzen ist natürlich erlaubt.

Slim4: 405 Method Not Allowed

Wenn Slim V4 folgende Fehlermeldung ausgibt:

405 Method Not Allowed

The application could not run because of the following error:

Type: Slim\Exception\HttpMethodNotAllowedException
Code: 405
Message: Method not allowed. Must be one of: get, post
File: /var/www/html/demo/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 96

#0 /vendor/slim/slim/Slim/Routing/RouteRunner.php(72): Slim\Middleware\RoutingMiddleware->performRouting(Object(Slim\Psr7\Request))
#1 /vendor/slim/twig-view/src/TwigMiddleware.php(125): Slim\Routing\RouteRunner->handle(Object(Slim\Psr7\Request))
#2 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Views\TwigMiddleware->process(Object(Slim\Psr7\Request), Object(Slim\Routing\RouteRunner))
#3 /vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(107): class@anonymous->handle(Object(Slim\Psr7\Request))
#4 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Psr7\Request), Object(class@anonymous))
#5 /app/Middleware/TestMiddleware.php(13): class@anonymous->handle(Object(Slim\Psr7\Request))
#6 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): App\Kernel\System\Middleware\TestMiddleware->__invoke(Object(Slim\Psr7\Request), Object(class@anonymous))
#7 /app/Middleware/Test.php(12): class@anonymous->handle(Object(Slim\Psr7\Request))
#8 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): App\Kernel\System\Middleware\Test->__invoke(Object(Slim\Psr7\Request), Object(class@anonymous))
#9 /app/Middleware/TestMiddleware.php(146): class@anonymous->handle(Object(Slim\Psr7\Request))
#10 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): App\Kernel\System\Middleware\TestMiddleware->__invoke(Object(Slim\Psr7\Request), Object(class@anonymous))
#11 /app/Middleware/TestMiddleware.php(13): class@anonymous->handle(Object(Slim\Psr7\Request))
#12 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): App\Kernel\System\Middleware\ResponseHeaderMiddleware->__invoke(Object(Slim\Psr7\Request), Object(class@anonymous))
#13 /vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle(Object(Slim\Psr7\Request))
#14 /vendor/slim/slim/Slim/App.php(215): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request))
#15 /vendor/slim/slim/Slim/App.php(199): Slim\App->handle(Object(Slim\Psr7\Request))
#16 /public/index.php(150): Slim\App->run()
#17 {main}

… dann kann Ihnen eine der folgenden Lösungen helfen:
(mehr …)