且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

redis.so模块没有加载

更新时间:2023-02-22 10:57:42

解决的办法是做以下步骤来安装pH值为preDIS:

The solution was doing the following steps to install phpredis:

  • 在下载并解压pH值$​​ P $ PDIS
  • 命令 ZTS-运行phpize
  • 命令 ./配置--with-PHP-配置=的/ usr / bin中/ ZTS-PHP-配置
  • 命令制作和放大器;&安培;使安装
  • download and unzip phpredis
  • command zts-phpize
  • command ./configure --with-php-config=/usr/bin/zts-php-config
  • command make && make install

我在做运行phpize ,而不是 ZTS-运行phpize ,我并没有加入 --with-PHP-配置选项:这是问题

I was doing phpize and not zts-phpize and I was not adding the --with-php-config option: this was the problem

当然,你必须添加redis.ini到/etc/php-zts-5.6.d/文件夹,里面的文件:

Of course then you have to add redis.ini into /etc/php-zts-5.6.d/ folder with, inside the file:

extension=redis.so

重新启动Apache和它应该工作

Restart apache and it should work

希望这会帮助别人

P.S。如果你想让它的命令行(即PHP的script.php)工作,你也必须安装它与运行phpize 和简单的 ./配置命令。

P.S. If you want it to work from command line (i.e. "php script.php"), you have to install it also with phpize and simple ./configure command.