3

I am experiencing difficulties starting Redis 5.3.7 with PHP 8.2 on my Windows machine. When I attempt to start it, a dialog box displays with the message:

"The procedure entry point _zend_get_parameters_array_ex could not be located in the dynamic link library c:\Program Files\php\ext\php_redis.dll"

I have included a screenshot of the error below:

error screenshot

GanesH RahuL
  • 431
  • 5
  • 16

2 Answers2

4

Here the way I solve the problem

go to this page https://github.com/phpredis/phpredis/actions/runs/4930167168#artifacts, extensions are listed there.

working for me on xampp, php8.2.1 and redis 3.2.100 on windows 11

GanesH RahuL
  • 431
  • 5
  • 16
2

How to compile a PHP extension like Redis, under Windows. Since nobody really explains that.

Run commands under the old Windows shell, e.g. cmd.exe

You will need the 2019 version of the Microsoft C/C++ compiler, so the linker is compatible with the downloadable PHP for Windows. winget can found as "App Installer" in the Windows Store.

winget install --id Microsoft.VisualStudio.2022.BuildTools

In the Visual Studio Build Tools 2022 'modify' the install under the 'Individual components' tab, and select:

  • C++/CLI support for v142 build tools (14.29-16.11)
  • MSVC v142 - VS 2019 C++ x64/x86 build tools

Download PHP for Windows, also download and unzip the 'Development package (SDK to develop PHP extensions)' and probable also the 'Debug Pack'. In the 'Development package' there is a folder, you need to unzip the contents of that folder to the folder where you have php.exe. https://windows.php.net/download#php-8.2

Git clone https://github.com/phpredis/phpredis inside the folder where you have php.exe.

winget install --id Git.Git
git clone https://github.com/phpredis/phpredis.git
# or:
winget install --id Git.Git
winget install --id GitHub.cli
gh repo clone phpredis/phpredis

You might want to switch away from the main develop branch:

git tag # find the latest non-RC version, currently that is 5.3.7
git checkout 5.3.7

In a command shell cmd.exe inside the directory where you have php.exe.

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.29

.\configure.bat --enable-redis --with-prefix=%cd%\..

Check that in the Makefile PHP_PREFIX and PHP_SRC_DIR point to the directory holding php.exe and the phpredis source code, e.g.

  • PHP_SRC_DIR ="C:\laragon\bin\php\php-8.2.7-Win32-vs16-x64\phpredis"
  • PHP_PREFIX="C:\laragon\bin\php\php-8.2.7-Win32-vs16-x64\"

Then build with:

nmake clean
nmake
copy x64\Release_TS\php_redis.dll ..\ext\

In the php.ini:

extension=php_redis.dll

Then run php -m to see redis listed.

Henk Poley
  • 729
  • 8
  • 17