PHP 8.3 发布了,当然是第一时间上啦。项目用到了redis,但 pecl 官网上没提供对应的 dll 文件,只能自己编译了。
编译 PHP 8.3 需要使用 Visual Studio Community 2019
,太旧的版本不行,太新的2022版本支持又还不够好。
1.下载最新版本的Visual Studio Community 2019;
2.勾选使用 C++ 的桌面开发
,然后进行安装;
1.获取最新版本的PHP SDK;
git clone --depth 1 git@github.com:php/php-sdk-binary-tools.git php-sdk-binary-tools-master
2.双击打开目录下的phpsdk-vs16-x64.bat
;
3.执行创建所需的目录结构;
phpsdk_buildtree phpmaster
1.获取 PHPRedis 仓库源代码;
git clone --single-branch --branch 5.3.7 git@github.com:phpredis/phpredis.git pecl/redis
1.获取 PHP 仓库源代码;
git clone --branch PHP-8.3 git@github.com:php/php-src.git php-src
2.转到php-src
目录;
cd php-src
1.执行 phpsdk_deps --update --branch 8.3
命令来自动获取依赖文件;
buildconf --force
线程安全版本:
configure --disable-all --with-all-shared --enable-cli --enable-redis
nmake
非线程安全版本:
configure --disable-all --with-all-shared --disable-zts --enable-cli --enable-redis
nmake
如果想修改编译参数重新编译,可以先执行一次 buildconf --force
和 nmake clean
命令,然后再重新配置编译参数。
编译完成后,可以在 php-sdk-binary-tools-master/phpmaster/vs16/x64/php-src/x64/Release[_TS]
目录下找到 php_redis.dll
文件。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有