Laravel Deployment Issue - Class "Redis" Not Found in PhpRedisConnector.php
Hello there,
I'm currently facing an issue with my Laravel application during deployment, specifically related to the Redis extension. The error message I'm encountering is:
Error: Class "Redis" not found in file /app/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php on line 79
It's worth mentioning that everything works fine in local development using the Sail package, but the problem arises when deploying the application. I suspect that the Redis extension might not be installed during the deployment process with Nixpack.
I've attempted to address the issue by adding NIXPACKS_PKGS env variable with php82Extensions.redis, but unfortunately, it did not resolve the problem.
I also tried nixpacks.json
{
"php": {
"version": "8.2",
"extensions": ["redis"]
}
}
I'm seeking guidance on how to fix this issue without resorting to a custom Dockerfile. Any insights or suggestions would be greatly appreciated.
Thank you in advance for your help!
5 Replies
Project ID:
dd5308ba-b2ca-4b35-ace1-f087ad08d315
dd5308ba-b2ca-4b35-ace1-f087ad08d315
👋
Lemme see here
Going to be honest, unsure how PHP in Railway resolves packages but will take a tiny look at the logs while I am on.
It seems to be complaining that you didn't set up your variables
You might want to set that up so your application can communicate with Redis @valeh3665
Hi @Angelo, yes, the goal is to use Redis as a queue in my case. While checking the data section of Redis, I noticed interaction with PHP after adding ext-redis as a Composer package. However, my intention was to achieve this without installing the Redis extension. In my local development Dockerfile, I have included the Redis extension installation step, which is currently sufficient for using Redis functionality. Additionally, for this or another purpose, how can I add PHP extensions to my build step?
@valeh3665 To add [install] a package during you build step, you can add to your nixpacks.toml: