php - Php Redis extension not working on wampserver windows10
问题描述
I have done the following steps to enable php_redis extension on my wampserver X64. Thread Safety was enabled.
Downloaded the Zip File from https://pecl.php.net/package/redis/5.2.2/windows this link.
Extract the zip file, copied php_redis.dll in
wamp64\bin\php\php7.3.12\ext\
directory.Added
extension=php_redis.dll
in php.ini file.Re-started the wamp Server.
Still I couldn't find redis on phpinfo()
.
When I check redis extension from WampServer tray icon, it showed me the following error:
The 'php_redis.dll' extension file exists but there is no 'extension=php_redis.dll' line in php.ini.
What am I missing here?
Php Version= 7.3.12, Windows 10 x64.
Update
I have re-installedwamp server, C++ redistributables and followed the same steps to enable php_redis extension. Now the previous error disappeared.
However, when I tried to use Redis on my code, it still shows error!
This time, I am getting the following error from my php error log:
[05-Jun-2020 12:45:17 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'redis' (tried: c:/wamp64/bin/php/php7.3.12/ext/redis (The specified module could not be found.), c:/wamp64/bin/php/php7.3.12/ext/php_redis.dll (The specified procedure could not be found.)) in Unknown on line 0
解决方案
请仔细按照以下步骤操作。
步骤 1. 打印phpinfo()
步骤 2. 检查 PHP 版本(例如 PHP 版本 7.4.0)并访问https://pecl.php.net/package/redis站点并根据您的 PHP 版本选择包。例如对于 PHP 7.4,https://pecl.php.net/package/redis/5.2.2/windows
第 3 步。在phpinfo(),
搜索“线程安全”中检查它是启用还是禁用。如果启用,您需要下载 Thread Safe (TS)。否则,请下载非线程安全 (NTS)
第 4 步。现在解压缩 zip 并获取php_redis.dll
并将其粘贴到 Wamp Server( wamp64\bin\php\php7.x.x\ext\
)中的 php 扩展文件夹中
第 5 步。添加extension=php_redis.dll
(php.ini
通过单击 Wamp->PHP->php.ini)
步骤 6. 重新启动 WAMP 服务器并redis
在phpinfo()
.
推荐阅读
- orocrm - ORO storefront RestAPI related entity normalization issue
- python-3.x - Python Virtual Environment Batch File Execution failing on Windows and not giving correct result
- java - Concatting Strings Across Functions
- r - R remove string after second underscore
- android - 在 Android 映像构建期间 build/core 查找 Android.mk/.bp 时如何排除目录?
- r - 在计数再次开始之前标记行
- python - Python包安装失败
- bash - 使用非 root 用户在 Dockerfile 中运行 root 服务
- javascript - 添加淡入淡出/动画
- gis - 为什么地理空间数据的 AWS Athena 二进制格式与 PostGIS 不同?