1. 程式人生 > >Windows 安裝PHP-redis擴展

Windows 安裝PHP-redis擴展

-s mic win .dll apache 使用 php.ini bin 一起

有沒有在Windows上安裝了redis但是一直安裝不上php-redis擴展的親呢?來一起學習一波吧!!!

安裝之前百度了好大一波呀,楞時沒裝上。。。

首先查看PHP信息(phpinfo):

  PHP Version 5.5.38;

  Architecture:x86

  Zend Extension Build: API220121212,TS,VC11

重點是:5.5、x86、TS、VC11,

  然後下載資源:

    https://windows.php.net/downloads/pecl/releases/igbinary/1.2.0/ //找到與你的PHP版本相符的igbinary.dll,根據我的PHP版本我應該使用

php_igbinary-1.2.0-5.5-ts-vc11-x86.zip,註意標紅的時PHP的版本號哦,經過多次嘗試,不選用這個是不正確的。
    https://windows.php.net/downloads/pecl/releases/redis/2.2.7/ //下載php-redis.dll,註意PHP版本號哦。

  下載好後把igbinary.dll、
php-redis.dll、php_redis.pdb放在PHP擴展目錄下,在php.ini中加入:
    
extension=php_igbinary.dll
  extension=php_redis.dll
  重啟Apache,查看phpinfo,就會看到redis擴展了。

Windows 安裝PHP-redis擴展