|
| 1 | +# PhpRedis Windows Build Tools |
| 2 | + |
| 3 | +Easy build PhpRedis binary DLL for windows. |
| 4 | + |
| 5 | +Links: |
| 6 | +- [PHP for Windows](https://windows.php.net) |
| 7 | +- [PhpRedis](https://github.com/phpredis/phpredis) |
| 8 | +- [PHP SDK Binary Tools](https://github.com/php/php-sdk-binary-tools) |
| 9 | +- [PhpRedis on PECL](https://pecl.php.net/package/redis) |
| 10 | + |
| 11 | + |
| 12 | +# Download |
| 13 | + |
| 14 | +- Visual Studio ( https://visualstudio.microsoft.com/downloads ) Download Community Edition |
| 15 | +- PHP SDK ( https://github.com/php/php-sdk-binary-tools ) Download source code ZIP |
| 16 | +- PHP Source ( https://windows.php.net/download ) Download source code ZIP |
| 17 | +- PhpRedis Source ( https://github.com/phpredis/phpredis ) Download source code ZIP |
| 18 | + |
| 19 | +# Prepare |
| 20 | + |
| 21 | +- Run [Visual Studio Setup], select `MSVC v142 VS2019 C++ x64/x86 build tools` and `Windows 11 SDK (10.0.22621.0)`, complete the installation according to the wizard. |
| 22 | +- Extract this tools to a empty folder, e.g., `c:\build` alias `{build}` |
| 23 | +- Extract SDKs and sources to specified folder, excluding the first level directory if exist: |
| 24 | + - PHP SDK -> `{build}\php-sdk` |
| 25 | + - PHP Source -> `{build}\php-src` |
| 26 | + - PhpRedis Source -> `{build}\php-src\ext\redis` |
| 27 | +- **Edit `{build}\_config.bat`** !!! |
| 28 | + |
| 29 | +# Run |
| 30 | + |
| 31 | +Open CMD console, cd `{build}`, run |
| 32 | + |
| 33 | +`init.bat` |
| 34 | + |
| 35 | +if no error accured, next |
| 36 | + |
| 37 | +`build.bat` |
| 38 | + |
| 39 | +# Output |
| 40 | + |
| 41 | +`php_redis_nts.dll` or `php_redis_ts.dll` you will find in `{build}\release` |
| 42 | + |
| 43 | +# Remark |
| 44 | + |
| 45 | +- Open CMD console,run `{build}\env.bat` to initialize runtime environment,if you want to run tools related. |
| 46 | +- This script is support x64 only. |
0 commit comments