Introducing Dragonfly Cloud! Learn More

Error: cannot find save handler 'redis'

What's Causing This Error

If you encounter the error message 'cannot find save handler 'redis'' while using Redis as a session storage backend in your web application, it means that the web server cannot locate the Redis session save handler which is crucial for storing session data in Redis.

This issue can be caused by different factors including incorrect or missing configuration settings in the php.ini file, an incompatible version of PHP with the Redis extension or the absence of the Redis extension on the server.

Solution - Here's How To Resolve It

To fix this error, you can try the following solutions:

  1. Install and enable Redis extension: Verify if Redis extension is installed by running php -m | grep redis in terminal. If not, install it using apt-get or yum depending on your Linux distribution. After installation, add extension=redis.so in the php.ini file to enable the extension.

  2. Check php.ini settings: Ensure session.save_handler directive is set to "redis" and session.save_path directive points to the correct Redis server configuration. To check these, refer to the php.ini file in your PHP installation directory.

  3. Confirm PHP version compatibility: Check compatibility between PHP version and Redis extension via the Redis extension documentation. Upgrade or downgrade PHP if required.

  4. Restart web server: Apply any changes made to the php.ini file or the Redis extension installation by restarting the web server.

By following these steps, you should be able to fix the 'cannot find save handler 'redis'' error and use Redis as the session storage backend in your web application without further issues.

Was this content helpful?

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.