# Latest

**URL:** https://discourse.slimframework.com/latest.md?page=2

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

**Page:** 3

---

## [Slim does not work when Nginx is enabled](https://discourse.slimframework.com/t/slim-does-not-work-when-nginx-is-enabled/5992)

<div class="topic-metadata">

**Author:** [@EgorKa](https://discourse.slimframework.com/u/EgorKa)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 5:03am UTC](https://discourse.slimframework.com/t/slim-does-not-work-when-nginx-is-enabled/5992 "2024-09-26T05:03:27Z")

</div>

Slim does not work when Nginx is enabled - 404 is always issued. The Apache2 server. Maybe you need additional Nginx configuration?

---

## [MVC Framework for Slim 4](https://discourse.slimframework.com/t/mvc-framework-for-slim-4/5991)

<div class="topic-metadata">

**Author:** [@rotexdegba](https://discourse.slimframework.com/u/rotexdegba)\
**Replies:** 0\
**Last updated:** [September 22, 2024, 1:13pm UTC](https://discourse.slimframework.com/t/mvc-framework-for-slim-4/5991 "2024-09-22T13:13:56Z")

</div>

Check out an MVC framework GitHub - rotexsoft/slim-skeleton-mvc-app: This is a template web-application (powered by SlimPHP), that can be extended to build more complex web applications. I built on top of Slim 4. I star…

---

## [Differences between Apache and Nginx (From Brasil)](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984)

<div class="topic-metadata">

**Author:** [@vinibarr](https://discourse.slimframework.com/u/vinibarr)\
**Replies:** 2\
**Last updated:** [September 15, 2024, 10:44am UTC](https://discourse.slimframework.com/t/differences-between-apache-and-nginx-from-brasil/5984 "2024-09-15T10:44:26Z")

</div>

Hi guys; I´m using a basic slim api V4; in apache server, i can read header, BUT in Nginx, i can´t; what i have to do to work in Nginx, please? $app = AppFactory::create(); $app-\>addBodyParsingMiddleware(); $errorMid…

---

## [How to use a DI container when working with symfony/console commands?](https://discourse.slimframework.com/t/how-to-use-a-di-container-when-working-with-symfony-console-commands/5982)

<div class="topic-metadata">

**Author:** [@Bezlepkin](https://discourse.slimframework.com/u/Bezlepkin)\
**Replies:** 2\
**Last updated:** [September 6, 2024, 9:06am UTC](https://discourse.slimframework.com/t/how-to-use-a-di-container-when-working-with-symfony-console-commands/5982 "2024-09-06T09:06:59Z")

</div>

Hi! I’m trying to do a console command to create a user. I connected symfony/console according to the following example: https://odan.github.io/slim4-skeleton/console.html But I don’t understand how to access the ID c…

---

## [Validation of UploadedFileInterface::getClientMediaType](https://discourse.slimframework.com/t/validation-of-uploadedfileinterface-getclientmediatype/5981)

<div class="topic-metadata">

**Author:** [@dakujem](https://discourse.slimframework.com/u/dakujem)\
**Replies:** 4\
**Last updated:** [September 2, 2024, 6:51pm UTC](https://discourse.slimframework.com/t/validation-of-uploadedfileinterface-getclientmediatype/5981 "2024-09-02T18:51:55Z")

</div>

I just came across this issue with PSR-7. I have UploadedFileInterface files from the request and I need to validate if the client sent us the correct media type. Normally one would take the $\_FILES\['file'\]\['tmp\_name'\] …

---

## [Any Module or library for adding security to Slim Php?](https://discourse.slimframework.com/t/any-module-or-library-for-adding-security-to-slim-php/5980)

<div class="topic-metadata">

**Author:** [@progremmer](https://discourse.slimframework.com/u/progremmer)\
**Replies:** 3\
**Last updated:** [August 25, 2024, 9:04am UTC](https://discourse.slimframework.com/t/any-module-or-library-for-adding-security-to-slim-php/5980 "2024-08-25T09:04:38Z")

</div>

Hi, I am new to web programming. Maybe there are already some protection library for security best practice that can i use?

---

## [How to test a service class?](https://discourse.slimframework.com/t/how-to-test-a-service-class/5976)

<div class="topic-metadata">

**Author:** [@hum4n0id3](https://discourse.slimframework.com/u/hum4n0id3)\
**Replies:** 2\
**Last updated:** [August 19, 2024, 6:41pm UTC](https://discourse.slimframework.com/t/how-to-test-a-service-class/5976 "2024-08-19T18:41:12Z")

</div>

Hello! I have written a PostUpdater service in Slim as follows: \<?php declare(strict\_types=1); namespace App\\Domain\\Post\\Service; use App\\Domain\\Post\\Data\\Post; use App\\Domain\\Post\\Repository\\PostUpdaterRepository; …

---

## [Slim app deployment on cPanel with the LiteSpeed server?](https://discourse.slimframework.com/t/slim-app-deployment-on-cpanel-with-the-litespeed-server/5975)

<div class="topic-metadata">

**Author:** [@santokhan](https://discourse.slimframework.com/u/santokhan)\
**Replies:** 0\
**Last updated:** [August 16, 2024, 5:21am UTC](https://discourse.slimframework.com/t/slim-app-deployment-on-cpanel-with-the-litespeed-server/5975 "2024-08-16T05:21:51Z")

</div>

It works fine with Apache2 and does not require any setup. However, the initial application is not running on LiteSpeed What could be the reason? I have tried many solutions. But does not work like NGINX and APACHE2.

---

## [Flash Messages for Slim 4](https://discourse.slimframework.com/t/flash-messages-for-slim-4/5972)

<div class="topic-metadata">

**Author:** [@WilliamSampaio](https://discourse.slimframework.com/u/WilliamSampaio)\
**Replies:** 0\
**Last updated:** [August 13, 2024, 10:21pm UTC](https://discourse.slimframework.com/t/flash-messages-for-slim-4/5972 "2024-08-13T22:21:55Z")

</div>

Hello! I recently needed to use the flash messages feature in a Slim4 application. Well, it’s not something out of this world… I could implement several workarounds for this. But I decided to look for a ready-made solut…

---

## [The JWT string must have two dots](https://discourse.slimframework.com/t/the-jwt-string-must-have-two-dots/5968)

<div class="topic-metadata">

**Author:** [@LaBaude](https://discourse.slimframework.com/u/LaBaude)\
**Replies:** 1\
**Last updated:** [August 7, 2024, 3:50pm UTC](https://discourse.slimframework.com/t/the-jwt-string-must-have-two-dots/5968 "2024-08-07T15:50:39Z")

</div>

Hi, I had a strange problem after a dependency update and deployment on my server, I got this error : { "message": "Slim Application Error", "exception": \[ { "type": "Lcobucci\\\\JWT\\\\Token\\\\Inval…

---

## [How to get started](https://discourse.slimframework.com/t/how-to-get-started/5966)

<div class="topic-metadata">

**Author:** [@rabol](https://discourse.slimframework.com/u/rabol)\
**Replies:** 2\
**Last updated:** [August 7, 2024, 10:53am UTC](https://discourse.slimframework.com/t/how-to-get-started/5966 "2024-08-07T10:53:45Z")

</div>

Hi Over the the past 5-6 years I have always used Laravel, and I really like it it, but… I feel like there is too many features that gets loaded on each request - it’s not a complaint, just a fact - and for some projec…

---

## [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 …

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

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