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

AlexG834's avatar

Please make sure the PHP Redis extension is installed and enabled.

I'm getting spammed with Please make sure the PHP Redis extension is installed and enabled. in my logs, despite having the redis.so extension installed on MacOS. I installed the Redis extension by running pecl install redis, which succeeds with the following message:

Installing '/usr/local/Cellar/php/7.3.12/pecl/20180731/redis.so'
install ok: channel://pecl.php.net/redis-5.1.1
Extension redis enabled in php.ini

By running phpinfo() in tinker, I can see that my loaded php.ini is

Configuration File (php.ini) Path => /usr/local/etc/php/7.3
Loaded Configuration File => /usr/local/etc/php/7.3/php.ini

If I open up /usr/local/etc/php/7.3/php.ini, extension="redis.so" is listed at the top of the file.

What makes this more and more strange is that if I dig deeper into where the original Please make sure the PHP Redis extension is installed and enabled. error is coming from, it looks to be in laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:76, which looks like this:

throw new LogicException(extension_loaded('redis') ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'  : 'Please make sure the PHP Redis extension is installed and enabled.');

So according to this, the extension isn't loaded. But if I load up tinker again and run extension_loaded('redis') then I get a true result.

I can't for the life of me figure out what's going on here. Why does PhpRedisConnector not see that the extension is loaded?

For completeness, I've also removed the Redis alias from my app.php file as instructed to by the Laravel docs.

0 likes
19 replies
AlexG834's avatar

Same php.ini, confirmed Redis loaded.

philaMNE's avatar

@alexgodbehere Hello! maybe try and install predis/predis package via Composer?

Note: are you stopping your php artisan serve command and starting it again?

AlexG834's avatar

Thanks, but I'm using phpredis not predis.

Sinnbeck's avatar

And this returns true as well in web? extension_loaded('redis')

AlexG834's avatar

Yes, extension_loaded('redis') returns true when placed at the top of routes/web.php.

AlexG834's avatar

@philamne, I'm using Valet, but yes I've tried to restart it. The jobs that are causing it to fail are being ran b the scheduler though, if that makes any difference.

AlexG834's avatar

Ok, additional update. I'm using Redis elsewhere in my application to store the value of when a user was last seen, which is still working well.

use Illuminate\Support\Facades\Redis;

public function getLastSeenAttribute() {
    $redis = Redis::connection();
    return $redis->get('last_seen_'.$this->id);
}

alt text

MDooley47's avatar

Check which version of php your valet installation is using. Putting phpinfo(); die(); in public/index.php let me see that it was using [email protected] instead of the [email protected] I run in my terminal. To change the version use valet use php7.3 with 7.3 being your target version.

pecl install redis enables it for the version of php returned by php -v

1 like
chris-lw's avatar

I know this is an old thread but for me valet restart does not seem to recognise the change in ini file configuration. Running php -i | grep redis was saying redis was loaded fine but phpinfo() was not. Running brew services restart php did work. I figured this out after restarting valet several times. So i'm adding this here incase anybody stumbles on this thread like I did.

5 likes
adammench's avatar

Laravel 6 changed the default Redis client from predis to phpredis. You may keep using predis by setting REDIS_CLIENT=predis for your environment.

9 likes
nasrulhazim's avatar

mine work fine after run pecl install redis and valet restart

4 likes
waynethorley's avatar

Did anyone resolve the issue of receiving this error solely in the task scheduler?

I have redis working everywhere else in my app perfectly fine, however when I try to dispatch an event from App/Console/Kernel.php it throws the following error:

local.ERROR: Please make sure the PHP Redis extension is installed and enabled.

waynethorley's avatar

So I figured it out - posting here incase it helps anyone else.

My cron entry that calls the task scheduler looked like this, as per laravel docs:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Running which php in the project root returned /usr/local/bin/php

After updating the cron entry with the absolute path to php:

* * * * * cd /path-to-your-project && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

The issue was resolved. Seems that it was executing under a different php version that didn't have the redis.so module enabled

BLH's avatar

Just posting my experience with this issue, to help anyone who the posts above didnt help. I just upgraded a 5.7 Laravel app to 7.*. I installed phpredis via pecl, but installation will fail on mac unless you have Xcode command line tools v^12.5 or later. You will also need to restart php after installation but valet restart will not work, you need to restart it with brew or manually depending on your dev environment. However in my case, I had to restart my computer, for everything to work as it should. Also, if you are upgrading from predis, you'll need to remove the Redis facade from config/app.php, and make sure your .env has the proper REDIS_CLIENT set. just for notation I'm currently running the latest iteration of php 7.4

1 like

Please or to participate in this conversation.