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

FlorentPoujol's avatar

Horizon immediately shuts down silently after successful starts

Hello

At work we updated our 2 apps to the last versions of PHP, Laravel and Horizon among other.

For only one of the app, horizon doesn't work when deployed on our hosting provider.

Horizon boots normally and I get the "Horizon started successfully." message but the command just terminates immediately after without any error message, in the console or any of the logs.

And obviously I don't reproduce it at all in our local environment, even when reoving dev dependencies, setting the env to 'production', etc...

The horizon repo has no issue that could match that behavior, I couldn't find anything either online, both apps have the same OS and versions of PHP/Laravel/Horizon, etc...

Could it be caused by PCNTL ? It is definitely installed and has the same default config in both apps...

Do any of you have any idea what could be the cause of it, or how to diagnose (unfortunately the filesystem on our hosting provider (Scalingo) is read-only, so I can't even add debug line in the horizon command) ?

Many thanks in advance !

0 likes
2 replies
FlorentPoujol's avatar

A little update : it works just fine if we switch back to PHP7.4, without changing anything in our code (except some composer dependencies (Laravel and Horizon are still on the exact same version as in PHP8.0)).

FlorentPoujol's avatar
FlorentPoujol
OP
Best Answer
Level 2

I found why \o/.

Since the beginning, the value for Horizon's memory_limit config was "196M" instead of just 196.

In PHP7.4, the condition 34 > "196M" is false because it is "converted" to 34 > 196. In PHP8.0, the same condition is true, because I think "196M" gets casted to 0 in conditions...

This is what makes Horizon shutdown itself silently on startup, because it thinks it consume to much memory.

It does not explain however why in one of our app, it does work even if we do are in PHP8.0...

I will probably submit a PR to Horizon to add an explicit error message when that happens.

Please or to participate in this conversation.