12
votes

I tried both the files from here: https://github.com/nicolasff/phpredis/downloads. I am using 64bit wampserver on windows 7 professional. It looks like apache is trying to load the file but somehow could not recognize it properly. This is what I see in the error log:

PHP Startup: Unable to load dynamic library 'D:/wamp/bin/php/php5.3.13/ext/php_redis.dll' - %1 is not a valid Win32 application.

Anyone faced similar issues? Do we have a working solution for this?

7
put the value of extension_dir in your php.ini. it should be something like C:\xampp\php\ext - undone
@ZiTAL I tried both the DLLs. Do you have a link for working dll? - Vikash
i wish this will be useful for you stackoverflow.com/questions/2001075/… - ZiTAL
I am not looking for a php library like predis. I wanted to have the extension working - specially for speed and session.save_path=redis. - Vikash
Is the path, D:/wamp/bin/php/php5.3.13/ext/php_redis.dll, proper? I wonder whether the forward slashes should be back slashes () instead, but if this is in line with how it's laid out in Apache's .conf file then this may be irrelevant. - Darth Continent

7 Answers

3
votes

Just in case it can help someone, I managed to solve the error on PHP 7.1.12 installing the 32 bits DLL.

I was getting the error:

Warning: PHP Startup: Unable to load dynamic library '.../php_redis.dll'
not a valid Win32 application

But after installing the 32 bits version, the warning disappeared.

To know which architecture of XAMPP/WAMP are you using, visit the phpinfo() and look for the value "Architecture", it was for me on the fourth row, and as expected is had the value x86.

3
votes

I had to check the Server API from phpinfo() to decide which version to use

If It's Apache 2.0 Handler(mod_php) go with Thread Safe version

If It's CGI go with Non Thread Safe version

2
votes

Unfortunately I do not run 64-bit version of PHP to test this, but for PHP 5.3 you can try this dll.

Dll from https://github.com/nicolasff/phpredis/downloads ( php_redis-2.1.3-5.2-vc6-ts-4350b2a.zip ), is working fine with PHP 5.2.17 (32-bit version).

I hope you will solve the problem.

1
votes

I used XAMPP x86 / PHP 7.2.5 so I needed redis x86 and the directory is this: C:/xampp/php/ext/.

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

0
votes

I'll add my ansewer to the table :

I used those dlls for my AMPPS server (WAMP should be the same) under windows 8 with PHP 5.5: https://pecl.php.net/package/redis/2.2.7/windows

following this tutorial

https://www.linkedin.com/pulse/using-redis-windows-php-shekhar-joshi

0
votes

I had same issue for 64 bit windows 7 wampserver with PHP5.5.12 and worked for me from below link dll binaries of Redis

http://windows.php.net/downloads/pecl/releases/redis/2.2.7/

0
votes

I had the same case, I was installing wamp 32bit, but I imported the library in 64bit however I had to imorted the 32bit version.

Check in the task manager which version of wamp you are using!