so each server will have its own .env file
Then just pull the value from env in the horizon config file ... same as any other env parameter?
The config file just returns an array, you can put logic in there such as a switch statement
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm hoping someone can help me with this.
I have several servers running my queues using Horizon and Redis. All servers are in production enviroment and sharing the same codebase.
I'm trying to ensure that certain EC2 servers only run specific queues and have unique configurations. I know I can add custom enviromnet in Horizon.php which will get the environment from th .env file. But is there any other way to do this?
What ideally I'm looking to do is something along these lines.
In the .env file add a new line called "SERVER_NAME=SERVER1" and in config/horizon.php I want to set unique environment for each server based on the SERVER_NAME environment variable.
Or is there any other recommended way of doing this?
In summary: All servers must share the same code base. It doesn't sound like a good idea to give each server a unique environment name (APP_ENV=local) I want each server to run only specific queues
Any feedback or recommendation would be very much appreciated.
Please or to participate in this conversation.