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 Filesphpextphp_redis.dll"
I have included a screenshot of the error below:
2
Answers
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
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.In the Visual Studio Build Tools 2022 ‘modify’ the install under the ‘Individual components’ tab, and select:
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.2Git clone https://github.com/phpredis/phpredis inside the folder where you have
php.exe
.In a command shell
cmd.exe
inside the directory where you havephp.exe
.In the Makefile fix PHP_SRC_DIR to point to phpredis, e.g.
PHP_SRC_DIR ="C:laragonbinphpphp-8.2.7-Win32-vs16-x64phpredis"
Also fix the PHP_PREFIX to point to PHP, e.g.
PHP_PREFIX="C:laragonbinphpphp-8.2.7-Win32-vs16-x64"
In the php.ini:
Then run
php -m
to see redis listed.