# Questions

**URL:** https://discourse.slimframework.com/c/questions/1.md?page=2

[Latest](https://discourse.slimframework.com/latest.md) · [Categories](https://discourse.slimframework.com/categories.md)

**Page:** 3

---

## [How can slim replace lumen?](https://discourse.slimframework.com/t/how-can-slim-replace-lumen/5967)

<div class="topic-metadata">

**Author:** [@macropay-solutions](https://discourse.slimframework.com/u/macropay-solutions)\
**Replies:** 0\
**Last updated:** [August 7, 2024, 10:53am UTC](https://discourse.slimframework.com/t/how-can-slim-replace-lumen/5967 "2024-08-07T10:53:08Z")

</div>

Inspired by How to get started that references laravel to have too much overhead (and we could add that they also suggest ditching lumen), could slim replace lumen like an out of the box alternative that you should not b…

---

## [How to protect admin panel with htaccess](https://discourse.slimframework.com/t/how-to-protect-admin-panel-with-htaccess/5964)

<div class="topic-metadata">

**Author:** [@markosci](https://discourse.slimframework.com/u/markosci)\
**Replies:** 0\
**Last updated:** [August 2, 2024, 9:28am UTC](https://discourse.slimframework.com/t/how-to-protect-admin-panel-with-htaccess/5964 "2024-08-02T09:28:12Z")

</div>

Hello guys! I’m making a project with SLIM and that includes a little admin panel. I’ve the next structure: \* myproject \* public \* index.php \* .htaccess \* assets \* templates \*…

---

## [Help Needed- Class 'Slim\\Slim' Not Found Error](https://discourse.slimframework.com/t/help-needed-class-slim-slim-not-found-error/5957)

<div class="topic-metadata">

**Author:** [@laylacollins](https://discourse.slimframework.com/u/laylacollins)\
**Replies:** 2\
**Last updated:** [July 30, 2024, 6:02pm UTC](https://discourse.slimframework.com/t/help-needed-class-slim-slim-not-found-error/5957 "2024-07-30T18:02:26Z")

</div>

Hey everyone, I’m pretty new to Slim and just started working on a project using Slim Framework. I’m running into an issue and could really use some help from the community. I’m getting the following error: Class 'Sli…

---

## [New HTTP Exceptions](https://discourse.slimframework.com/t/new-http-exceptions/5961)

<div class="topic-metadata">

**Author:** [@EgorKa](https://discourse.slimframework.com/u/EgorKa)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 6:00pm UTC](https://discourse.slimframework.com/t/new-http-exceptions/5961 "2024-07-29T18:00:14Z")

</div>

Hello! https://www.slimframework.com/docs/v4/middleware/error-handling.html#new-http-exceptions I don’t understand what to do with these classes. There are no examples. How to use them? Please help me.

---

## [Running in a sub-directory 2](https://discourse.slimframework.com/t/running-in-a-sub-directory-2/5954)

<div class="topic-metadata">

**Author:** [@odan](https://discourse.slimframework.com/u/odan)\
**Replies:** 5\
**Last updated:** [July 23, 2024, 2:24pm UTC](https://discourse.slimframework.com/t/running-in-a-sub-directory-2/5954 "2024-07-23T14:24:00Z")

</div>

Hi, I have a simple slim app, I can’t make it work on shared hosting. I’ve already tried using the subdirectory and it doesn’t work. In the Windows environment, class mapping works correctly, in Linux (shared hosting) it…

---

## [Running in a sub-directory](https://discourse.slimframework.com/t/running-in-a-sub-directory/5893)

<div class="topic-metadata">

**Author:** [@joeworkman](https://discourse.slimframework.com/u/joeworkman)\
**Replies:** 9\
**Last updated:** [May 7, 2024, 11:44pm UTC](https://discourse.slimframework.com/t/running-in-a-sub-directory/5893 "2024-05-07T23:44:18Z")

</div>

I know that this question has been asked a bunch. But I still cannot get this working. I am trying to run my app from inside /api on my server. I have read @akrabat’s blog post article and set up my htaccess file. This …

---

## [Slim 5 planned in near future?](https://discourse.slimframework.com/t/slim-5-planned-in-near-future/5247)

<div class="topic-metadata">

**Author:** [@trendschau](https://discourse.slimframework.com/u/trendschau)\
**Replies:** 6\
**Last updated:** [July 18, 2024, 4:22pm UTC](https://discourse.slimframework.com/t/slim-5-planned-in-near-future/5247 "2024-07-18T16:22:24Z")

</div>

I want to upgrade my application from slim 3 to slim 4 this year and now I see the slim5 tag on github. Is there already a roadmap for slim5?

---

## [PHP Slim 4 on subdomain. Problem with generating route: hostname](https://discourse.slimframework.com/t/php-slim-4-on-subdomain-problem-with-generating-route-hostname/5944)

<div class="topic-metadata">

**Author:** [@dubaksk](https://discourse.slimframework.com/u/dubaksk)\
**Replies:** 14\
**Last updated:** [July 18, 2024, 8:24am UTC](https://discourse.slimframework.com/t/php-slim-4-on-subdomain-problem-with-generating-route-hostname/5944 "2024-07-18T08:24:49Z")

</div>

I have small website on webhosting subdomain. Locally everything works. After uploading to webhosting, project is running: https://cv.dubak.sk/ Content of routes: $app-\>get('/', \\App\\Action\\HomeAction::class)-\>setName(…

---

## [Request exceeded the limit of 10 internal redirects](https://discourse.slimframework.com/t/request-exceeded-the-limit-of-10-internal-redirects/5945)

<div class="topic-metadata">

**Author:** [@samclia](https://discourse.slimframework.com/u/samclia)\
**Replies:** 9\
**Last updated:** [July 17, 2024, 1:45pm UTC](https://discourse.slimframework.com/t/request-exceeded-the-limit-of-10-internal-redirects/5945 "2024-07-17T13:45:55Z")

</div>

Good afternoon, I’m migrating a Slim website and I’m having trouble. There’s a problem with Apache. The local version of the website is working. Here is the Apache log of the site: \[Tue Jul 16 12:27:28.306707 2024\] \[f…

---

## [Setting a twig block from a route](https://discourse.slimframework.com/t/setting-a-twig-block-from-a-route/5943)

<div class="topic-metadata">

**Author:** [@Simon](https://discourse.slimframework.com/u/Simon)\
**Replies:** 1\
**Last updated:** [July 15, 2024, 11:15am UTC](https://discourse.slimframework.com/t/setting-a-twig-block-from-a-route/5943 "2024-07-15T11:15:30Z")

</div>

Is it possible to set the content of a block of a twig template directly from php inside a slim route instead of extending the template ? $app-\>get('/myRoute', function (Request $request, Response $response) { $twig…

---

## [How extend Slim\\App?](https://discourse.slimframework.com/t/how-extend-slim-app/5913)

<div class="topic-metadata">

**Author:** [@jobasco](https://discourse.slimframework.com/u/jobasco)\
**Replies:** 6\
**Last updated:** [July 11, 2024, 7:08am UTC](https://discourse.slimframework.com/t/how-extend-slim-app/5913 "2024-07-11T07:08:42Z")

</div>

Hi, i want extend the slim\\app class but i am getting this error message. \[07-Jun-2024 13:06:51 UTC\] PHP Fatal error: Uncaught TypeError: DI\\Definition\\Source\\DefinitionFile::{closure}(): Argument #1 ($app) must be of …

---

## [Slim 4 + FrankenPHP + worker mode](https://discourse.slimframework.com/t/slim-4-frankenphp-worker-mode/5813)

<div class="topic-metadata">

**Author:** [@artello](https://discourse.slimframework.com/u/artello)\
**Replies:** 2\
**Last updated:** [July 10, 2024, 4:15pm UTC](https://discourse.slimframework.com/t/slim-4-frankenphp-worker-mode/5813 "2024-07-10T16:15:48Z")

</div>

Hey, Just curious if anyone tried to use a Slim4 powered app with FrankenPHP Docker images and their worker mode (FrankenPHP | Using FrankenPHP Workers) specifically? I believe some code modification would be required …

---

## [Callable does not exist or because it is not a class nor a valid container entry](https://discourse.slimframework.com/t/callable-does-not-exist-or-because-it-is-not-a-class-nor-a-valid-container-entry/5517)

<div class="topic-metadata">

**Author:** [@reinier](https://discourse.slimframework.com/u/reinier)\
**Replies:** 7\
**Last updated:** [July 2, 2024, 2:17pm UTC](https://discourse.slimframework.com/t/callable-does-not-exist-or-because-it-is-not-a-class-nor-a-valid-container-entry/5517 "2024-07-02T14:17:46Z")

</div>

Im getting an error: Callable AppName\\Auth\\TestController::test does not exist It seems to be related to: Error "not a class nor a valid container entry" but the answers also did not solve my problem. Im sure its a st…

---

## [Handling Dependency Injection in Slim Framework 4](https://discourse.slimframework.com/t/handling-dependency-injection-in-slim-framework-4/5930)

<div class="topic-metadata">

**Author:** [@tiara](https://discourse.slimframework.com/u/tiara)\
**Replies:** 1\
**Last updated:** [June 30, 2024, 9:17am UTC](https://discourse.slimframework.com/t/handling-dependency-injection-in-slim-framework-4/5930 "2024-06-30T09:17:16Z")

</div>

Hello Slim community, :smiling\_face\_with\_three\_hearts: I am working on a project using Slim Framework 4 and I’m trying to get a better handle on dependency injection. I understand the basics, but I’m unsure about the be…

---

## [I cannot initializate php class (win 11, xampp 8.2)](https://discourse.slimframework.com/t/i-cannot-initializate-php-class-win-11-xampp-8-2/5928)

<div class="topic-metadata">

**Author:** [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Replies:** 1\
**Last updated:** [June 28, 2024, 12:59am UTC](https://discourse.slimframework.com/t/i-cannot-initializate-php-class-win-11-xampp-8-2/5928 "2024-06-28T00:59:31Z")

</div>

Hi guys; I cannot initializate my classes… I put in the begining of public/index.php this: use App\\DAO\\MySQL\\apiharustech\\ParceirosDAO; When i tried do instanciate: $ParceirosDAO = new ParceirosDAO(); I have this e…

---

## [Twig macros vs building an extension](https://discourse.slimframework.com/t/twig-macros-vs-building-an-extension/5929)

<div class="topic-metadata">

**Author:** [@joeworkman](https://discourse.slimframework.com/u/joeworkman)\
**Replies:** 1\
**Last updated:** [June 27, 2024, 5:33pm UTC](https://discourse.slimframework.com/t/twig-macros-vs-building-an-extension/5929 "2024-06-27T17:33:52Z")

</div>

I am building a CMS because the world definitely needs another one. I am using Twig as the templating language. Everything is working wonderfully. I have built a suite of twig macros that make it easy to build out forms …

---

## [Wrong status and Content-Type in controller](https://discourse.slimframework.com/t/wrong-status-and-content-type-in-controller/5927)

<div class="topic-metadata">

**Author:** [@ArmaNx7](https://discourse.slimframework.com/u/ArmaNx7)\
**Replies:** 5\
**Last updated:** [June 27, 2024, 5:09pm UTC](https://discourse.slimframework.com/t/wrong-status-and-content-type-in-controller/5927 "2024-06-27T17:09:23Z")

</div>

Hi I have a problem with status codes and header content type. Status is always 200 and content is always text/html This my routes.php $app-\>post('/', \[UserController::class, 'login'\]); And this my Controller: \<?php …

---

## [Why my post is not showing?](https://discourse.slimframework.com/t/why-my-post-is-not-showing/5932)

<div class="topic-metadata">

**Author:** [@tiara](https://discourse.slimframework.com/u/tiara)\
**Replies:** 1\
**Last updated:** [June 27, 2024, 4:47pm UTC](https://discourse.slimframework.com/t/why-my-post-is-not-showing/5932 "2024-06-27T16:47:41Z")

</div>

Recently I posted a query on this forum But it is not showing in community feed. Could anyone guide me about this. And please live my post.

---

## [Request body always empty](https://discourse.slimframework.com/t/request-body-always-empty/4051)

<div class="topic-metadata">

**Author:** [@benbao](https://discourse.slimframework.com/u/benbao)\
**Replies:** 3\
**Last updated:** [June 25, 2024, 4:41pm UTC](https://discourse.slimframework.com/t/request-body-always-empty/4051 "2024-06-25T16:41:30Z")

</div>

I am faced with a weird issue where the request body (both parsed and raw string body) is always empty with slim php. I removed all middleware from my code, re-installed composer packages and went as far to just run the …

---

## [How to Use laminas-config-aggregator In Slim](https://discourse.slimframework.com/t/how-to-use-laminas-config-aggregator-in-slim/5924)

<div class="topic-metadata">

**Author:** [@jobasco](https://discourse.slimframework.com/u/jobasco)\
**Replies:** 2\
**Last updated:** [June 22, 2024, 2:59pm UTC](https://discourse.slimframework.com/t/how-to-use-laminas-config-aggregator-in-slim/5924 "2024-06-22T14:59:46Z")

</div>

Hi, i want to use laminas-config-aggregator inside my slim app but it’s not working as i don’t have the needed know to make it work, This is what i have done so far. \<?php declare(strict\_types=1); namespace Ultral\\C…

---

## [How can i run slim 3 in php 8.2 ? it´s possible?](https://discourse.slimframework.com/t/how-can-i-run-slim-3-in-php-8-2-it-s-possible/5923)

<div class="topic-metadata">

**Author:** [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Replies:** 1\
**Last updated:** [June 21, 2024, 7:44am UTC](https://discourse.slimframework.com/t/how-can-i-run-slim-3-in-php-8-2-it-s-possible/5923 "2024-06-21T07:44:01Z")

</div>

How can i run slim 3 in php 8.2 ? it´s possible ? I tryed but not sucessfull… I have a api thats works beautiful in php 7.4 but i need that api in php 8.2… Tanks

---

## [Application GET handling url conflict](https://discourse.slimframework.com/t/application-get-handling-url-conflict/5922)

<div class="topic-metadata">

**Author:** [@silvat](https://discourse.slimframework.com/u/silvat)\
**Replies:** 1\
**Last updated:** [June 20, 2024, 6:45am UTC](https://discourse.slimframework.com/t/application-get-handling-url-conflict/5922 "2024-06-20T06:45:10Z")

</div>

Hello. I have this php app that I use to check the authentication of my users. I have the authentication working, but when my get is only specifying “/duo-callback”, it’s not accounting for the state variable and duo\_c…

---

## [Fail hello world windows 11 xampp 8.2 Slim 4.11.0 - June 2024](https://discourse.slimframework.com/t/fail-hello-world-windows-11-xampp-8-2-slim-4-11-0-june-2024/5914)

<div class="topic-metadata">

**Author:** [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Replies:** 3\
**Last updated:** [June 12, 2024, 3:18pm UTC](https://discourse.slimframework.com/t/fail-hello-world-windows-11-xampp-8-2-slim-4-11-0-june-2024/5914 "2024-06-12T15:18:44Z")

</div>

{ “require”: { “slim/slim”: “4.\*”, “nyholm/psr7”: “^1.8”, “nyholm/psr7-server”: “^1.1” } } Fatal error : Uncaught Slim\\Exception\\HttpNotFoundException: Not found. in C:\\xampp\\htdocs\\slimtdm\\vendor\\slim\\slim\\Slim\\M…

---

## [How to Deploy Slim to Server Host](https://discourse.slimframework.com/t/how-to-deploy-slim-to-server-host/5911)

<div class="topic-metadata">

**Author:** [@dordetch](https://discourse.slimframework.com/u/dordetch)\
**Replies:** 1\
**Last updated:** [June 7, 2024, 1:54pm UTC](https://discourse.slimframework.com/t/how-to-deploy-slim-to-server-host/5911 "2024-06-07T13:54:50Z")

</div>

I tried to deploy but it doesn’t work. This is my slim file. And this is the file on the server.

---

## [Slim 3 error on PHP 8.2](https://discourse.slimframework.com/t/slim-3-error-on-php-8-2/5909)

<div class="topic-metadata">

**Author:** [@abdo.host](https://discourse.slimframework.com/u/abdo.host)\
**Replies:** 1\
**Last updated:** [June 4, 2024, 8:32pm UTC](https://discourse.slimframework.com/t/slim-3-error-on-php-8-2/5909 "2024-06-04T20:32:43Z")

</div>

( ! ) Deprecated: Return type of Slim\\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #\[\\ReturnTypeWillChange\] attribute should be used to temporaril…

---

## [Slim 4. Which best skeleton?](https://discourse.slimframework.com/t/slim-4-which-best-skeleton/3934)

<div class="topic-metadata">

**Author:** [@Androbim](https://discourse.slimframework.com/u/Androbim)\
**Replies:** 5\
**Last updated:** [May 26, 2024, 2:03am UTC](https://discourse.slimframework.com/t/slim-4-which-best-skeleton/3934 "2024-05-26T02:03:03Z")

</div>

Hello! I want to make Slim application. I want to use skeleton for it. Now, I know two. From Josh Lokhart and Odan https://odan.github.io/slim4-skeleton/ Please give me, which best? Maybe, there are other skeletons? So…

---

## [Fresh installation composer error](https://discourse.slimframework.com/t/fresh-installation-composer-error/5906)

<div class="topic-metadata">

**Author:** [@aghezzi](https://discourse.slimframework.com/u/aghezzi)\
**Replies:** 0\
**Last updated:** [May 24, 2024, 4:39am UTC](https://discourse.slimframework.com/t/fresh-installation-composer-error/5906 "2024-05-24T04:39:48Z")

</div>

On a new fresh installation with composer on a host with already slim installed when issue : composer require slim/psr7 I have this error Updating dependencies Your requirements could not be resolved to an installable s…

---

## [JSON data and SLIM](https://discourse.slimframework.com/t/json-data-and-slim/5904)

<div class="topic-metadata">

**Author:** [@samclia](https://discourse.slimframework.com/u/samclia)\
**Replies:** 3\
**Last updated:** [May 22, 2024, 7:36am UTC](https://discourse.slimframework.com/t/json-data-and-slim/5904 "2024-05-22T07:36:23Z")

</div>

Good evening, In my project, I have middleware.php in the same directory as container.php. container.php: // construction de l'application $app App::class =\> function (ContainerInterface $container) { $app…

---

## [Slim Application Error - Class ‘Slim\\Http\\MobileRequest’ not found](https://discourse.slimframework.com/t/slim-application-error-class-slim-http-mobilerequest-not-found/5149)

<div class="topic-metadata">

**Author:** [@bop](https://discourse.slimframework.com/u/bop)\
**Replies:** 3\
**Last updated:** [May 21, 2024, 11:10am UTC](https://discourse.slimframework.com/t/slim-application-error-class-slim-http-mobilerequest-not-found/5149 "2024-05-21T11:10:48Z")

</div>

Hi, I’m sorry if this might look like an unnecessary question, but I’m totally new to PHP based stuff and quite new to web development in general. I got a task to make a website work again, which returns the following …

---

## [Error handler based on route](https://discourse.slimframework.com/t/error-handler-based-on-route/5902)

<div class="topic-metadata">

**Author:** [@thierryler](https://discourse.slimframework.com/u/thierryler)\
**Replies:** 1\
**Last updated:** [May 14, 2024, 4:31pm UTC](https://discourse.slimframework.com/t/error-handler-based-on-route/5902 "2024-05-14T16:31:33Z")

</div>

Hello. I’ve setup an Error Middleware in middlewares.php: $errorMiddleware = $app-\>addErrorMiddleware(true, true, true); $errorMiddleware-\>setDefaultErrorHandler($container-\>get(DefaultErrorHandler::class)); with Defa…

[Previous page](https://discourse.slimframework.com/c/questions/1.md?page=1)

[Next page](https://discourse.slimframework.com/c/questions/1.md?page=3)
