Wednesday, November 23, 2022

How to install and use the Redis extension in XAMPP locally in Windows 10

Here is the article. 

Learn how to easily install and use the Redis extension locally in XAMPP to communicate with Redis Servers.

I'm sure you may have already heard about Redis, the in-memory data structure store, used as a database and cache. Sooner or later, if you ever work with a project built with PHP that handles a significant amount of traffic and may require horizontal scaling, you will have to work with Redis. Of course in a local environment, it would be great to work as well with Redis, so you don't have to create huge conditionals to check if it's available in the current environment and run some logic if it isn't. It would be simpler to have Redis available locally as well, just to make the whole project work as usual in your workstation.

In this article, I will explain how to easily install the Redis extension for PHP in your XAMPP installation in Windows.

You can get those values with the function phpinfo() of PHP within an empty script:

<?php

phpinfo();

Once you know these values, you should be able to follow the rest of the tutorial.

1. Download Redis DLL

The first thing you need is the dynamic link library of Redis, which fortunately for us is already compiled and available in the PECL repository of PHP on this website. You may select the version that fits your needs, in my case, I will use the latest stable version as I'm using PHP 8, click on the DLL link with the windows icon:

No comments:

Post a Comment