18
votes

I'm trying to make Redis work on my windows machine for development purposes. I already made Redis up and running on my Ubuntu 10.04 server with phpredis client.

At the moment on my windows machine i can start Redis server, because it requires no installation and it is good enaugh for development, but I can't figure out how to install phpredis. It seems very confusing, I already spend two days working on this and no result.

I have cloned source files with Git, but i did that using Git Bash, but that was last command who worked in the same way as ubuntu. I also have downloaded two .dll files, one with 'ts' and another with 'nts', have no idea what is the difference :/

http://commandperls.com/install-phpredis/ there is manual how to install phpredis, but it works only on ubuntu for my. I'm very newbie for a command line and I'm not sure if this even suppose to work on windows, like with cmd or git bash.

So my question is, how can I make that phpredis work on windows? Is there is any way to make that happen? I know there is Predis and I already tried that one, but because I'm planning to use phpredis on my server, i would like to use same on development machine.

4
Indeed, the installation and making redis work on windows was very daunting for me as well. After using it successfully I pieced together an article on Linkedin, here there you go: using php on windows with phpShekhar Joshi

4 Answers

31
votes

Found it! Apologizing for misapprehension, but all this situation is really confusing for guy who such a little about servers management. Anyway, below is my solution.

http://code.google.com/p/pecl-win/downloads/detail?name=php_redis-2.1.3-5.3-ts.dll&can=2&q=

Link above provides .dll file, which in my case must be copied to: C:\xampp\php\ext and add a line in to php.ini file extension=php_redis.dll and lastly restart apache2 service.

And that's it, nothing has to be installed, as long as redis server already up and running this will provide connection between php and redis!

2020-05-06 update

Seems like previous url only contains outdated .dll files. @Niz provided in the comments an updated url where you can download the correct version of redis DLL for your windows. Make sure to download the one that matches your redis and php versions.

https://pecl.php.net/package/redis

10
votes

You can still find up to date compiled dll binaries of Redis(and many more) at the following location: http://windows.php.net/downloads/pecl/releases/redis/2.2.7/

    # php -i | find "Architecture"
    # php -i | find "Thread"
1
votes

Php 7 with redis support for xammp there are new binaries available in: https://windows.php.net/downloads/pecl/releases/redis/

1
votes

This worked for me :

Answer Referred from this Article : https://www.linkedin.com/pulse/using-redis-windows-php-shekhar-joshi/

Check all the information from phpinfo() such as x86 , php version and Thread Safety.

Useful Portion from the Article :

Download PECL extension from https://pecl.php.net/package/redis/2.2.7/windows , you need to know which version would work for you. First of all check out your php version and know whether thread safety is enabled or not(you can do this by using phpinfo()). Download the appropriate version of the dll, for thread safety enabled use ts version otherwise use nts version. Extract the contents and copy the .dll file in xamp/php/ext. Next, open the php.ini file located at(xampp/php) and add this string extension="php_redis.dll" together with other extensions.