Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gaspy's avatar
Level 1

Lumen 6.3 and PHP 7.4

I have an API built with Lumen 5.7 that runs on PHP 7.3 However, it doesn't work with PHP 7.4 - I get some errors in ServiceProvider.

So my questions are:

  1. Is Lumen 6.3 fully compatible with PHP 7.4?
  2. What would be the best way to upgrade my app from 5.7 to 6.x? There are lots of small changes in the framework, it looks like a daunting task. On the other hand, I really don't want to get stuck on one version of PHP...
0 likes
3 replies
mstrauss's avatar

In the Lumen 5.7 repo, the composer.json shows the below for PHP:

        "php": "^7.1.3",

And per the Composer Version Constraints below, I would think PHP 7.4 should be compatible:

The ^ operator behaves very similarly but it sticks closer to semantic versioning, and will always allow non-breaking updates. For example ^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility. For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0.

The Lumen 6.x GitHub repr shows the below in its composer.json file. So one would think that upgrading to this version would not be of much help in your scenario.

"php": "^7.2",

If you didn't already, I suggest running through all of the common update pitfalls, i.e. composer dump-autoload etc. and see if that's the issue at hand.

Bunch-a-devs's avatar

Its an old question, but the ServiceProvider is looking for config that has not yet been registered. Lumen does not automatically search the config directory, but instead each config file must be added into the /bootstrap/app.php file before the ServiceProvider class is called.

For example, $app->configure('view');

Which should come before $app->withEloquent();

Please or to participate in this conversation.