R
Railway•10mo ago
valeh3665

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
Percy
Percy•10mo ago
Project ID: dd5308ba-b2ca-4b35-ace1-f087ad08d315
valeh3665
valeh3665OP•10mo ago
dd5308ba-b2ca-4b35-ace1-f087ad08d315
angelo
angelo•10mo ago
👋 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
[laravel:warn] Your app configuration references the REDIS_USERNAME environment variable, but it is not set.

[laravel:warn] Your app configuration references the REDIS_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the REDIS_USERNAME environment variable, but it is not set.

[laravel:warn] Your app configuration references the LOG_SLACK_WEBHOOK_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_PORT environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT environment variable, but it is not set.

[laravel:warn] Your app configuration references the LOG_STDERR_FORMATTER environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_EHLO_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_LOG_CHANNEL environment variable, but it is not set.

[laravel:warn] Your app configuration references the SQS_SUFFIX environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAILGUN_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAILGUN_SECRET environment variable, but it is not set.

[laravel:warn] Your app configuration references the POSTMARK_TOKEN environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_CONNECTION environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_STORE environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_SECURE_COOKIE environment variable, but it is not set.
[laravel:warn] Your app configuration references the REDIS_USERNAME environment variable, but it is not set.

[laravel:warn] Your app configuration references the REDIS_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the REDIS_USERNAME environment variable, but it is not set.

[laravel:warn] Your app configuration references the LOG_SLACK_WEBHOOK_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_PORT environment variable, but it is not set.

[laravel:warn] Your app configuration references the PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT environment variable, but it is not set.

[laravel:warn] Your app configuration references the LOG_STDERR_FORMATTER environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_URL environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_EHLO_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAIL_LOG_CHANNEL environment variable, but it is not set.

[laravel:warn] Your app configuration references the SQS_SUFFIX environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAILGUN_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the MAILGUN_SECRET environment variable, but it is not set.

[laravel:warn] Your app configuration references the POSTMARK_TOKEN environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_CONNECTION environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_STORE environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_DOMAIN environment variable, but it is not set.

[laravel:warn] Your app configuration references the SESSION_SECURE_COOKIE environment variable, but it is not set.
You might want to set that up so your application can communicate with Redis @valeh3665
valeh3665
valeh3665OP•10mo ago
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?
snacsnoc
snacsnoc•10mo ago
@valeh3665 To add [install] a package during you build step, you can add to your nixpacks.toml:
[phases.build]
nixPkgs = ["php-redis"]
[phases.build]
nixPkgs = ["php-redis"]
Want results from more Discord servers?
Add your server