[GH-ISSUE #81] Class 'Redis' not found on 0.3.0 #678

Closed
opened 2026-03-14 10:05:12 +03:00 by kerem · 2 comments
Owner

Originally created by @mzch on GitHub (Sep 27, 2020).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/81

Updating to 0.3.0, the following error occurred.

$ sudo -u www-data php artisan queue:restart

   Error

  Class 'Redis' not found

  at vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:75
     71▕      * @throws \LogicException
     72▕      */
     73▕     protected function createClient(array $config)
     74▕     {
  ➜  75▕         return tap(new Redis, function ($client) use ($config) {
     76▕             if ($client instanceof RedisFacade) {
     77▕                 throw new LogicException(
     78▕                     extension_loaded('redis')
     79▕                         ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'

   A class import is missing: You have a missing class import. Try importing this class: `Illuminate\Support\Facades\Redis`.

      +22 vendor frames
  23  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Originally created by @mzch on GitHub (Sep 27, 2020). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/81 Updating to 0.3.0, the following error occurred. ```php $ sudo -u www-data php artisan queue:restart Error Class 'Redis' not found at vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:75 71▕ * @throws \LogicException 72▕ */ 73▕ protected function createClient(array $config) 74▕ { ➜ 75▕ return tap(new Redis, function ($client) use ($config) { 76▕ if ($client instanceof RedisFacade) { 77▕ throw new LogicException( 78▕ extension_loaded('redis') 79▕ ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.' • A class import is missing: You have a missing class import. Try importing this class: `Illuminate\Support\Facades\Redis`. +22 vendor frames 23 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) ```
kerem closed this issue 2026-03-14 10:05:17 +03:00
Author
Owner

@willbrowningme commented on GitHub (Sep 27, 2020):

You need to make sure that you have installed the php-redis module as mentioned in the release notes.

This can usually be done by running sudo apt install php-redis or installing the extension via PECL.

From the Laravel docs:

Before using Redis with Laravel, we encourage you to install and use the PhpRedis PHP extension via PECL. The extension is more complex to install but may yield better performance for applications that make heavy use of Redis.

<!-- gh-comment-id:699648981 --> @willbrowningme commented on GitHub (Sep 27, 2020): You need to make sure that you have installed the `php-redis` module as mentioned in the [release notes](https://github.com/anonaddy/anonaddy/releases/tag/v0.3.0). This can usually be done by running `sudo apt install php-redis` or installing the extension via PECL. From the Laravel [docs](https://laravel.com/docs/8.x/redis#introduction): > Before using Redis with Laravel, we encourage you to install and use the [PhpRedis](https://github.com/phpredis/phpredis) PHP extension via PECL. The extension is more complex to install but may yield better performance for applications that make heavy use of Redis.
Author
Owner

@mzch commented on GitHub (Sep 27, 2020):

Oh, I failed to notice it. Thanks! 👍

<!-- gh-comment-id:699650606 --> @mzch commented on GitHub (Sep 27, 2020): Oh, I failed to notice it. Thanks! 👍
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#678
No description provided.