Undefined class constant 'SERIALIZER_IGBINARY' 解决方法

问题背景:今天在新项目中调用了个发短信的接口,该接口是rpc封装好的一个服务,代码调用了\Redis::SERIALIZER_IGBINARY,本来在本地好好的,发到alpha环境报

Undefined class constant 'SERIALIZER_IGBINARY',Google了下发现是少了个igbinary扩展,因为我本地是装好了的,所以本地正常运行,下面是解决方法 。

解决方法:

1、安装igbinary扩展

1 wget http://pecl.php.net/get/igbinary-1.2.1.tgz
2 tar zxvf igbinary-1.2.1.tgz
3 cd igbinary-1.2.1
4 /usr/local/php/bin/phpize
5 ./configure --with-php-config=/usr/local/php/bin/php-config
6 make
7 make install

2、重新编译phpredis扩展

直接删除phpredis目录,重新下载编译

1 wget http://download.redis.io/releases/redis-2.6.14.tar.gz
2 tar zxvf redis-2.6.14.tar.gz
3 cd redis-2.6.14
4 /usr/local/php/bin/phpize
5 ./configure --enable-redis-igbinary --with-php-config=/usr/local/php/bin/php-config
6 make
7 make install

3、php.ini加载扩展

 1 vim /usr/local/php/etc/php.ini 2 加上: 3 extensions=igbinary.so (加载redis 扩展之前) 4 extensions=redis .so 

4、重启配置文件

 1 /etc/init.d/nginx reload 2 /etc/init.d/php-fpm restart 

再重新访问,success

 

转载于:https://www.cnblogs.com/hadeswp/p/5819737.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值