Memcached::get()could not unserialize value, no igbinary support
使用laravel Cache::get()时报错,版本PHP7 ,报错文件
vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php
已安装igbinary扩展
#php -m|grep igbinary
igbinary
更新,重新安装memcached,3.x版本是支持php7的,而php5.2-5.6需要使用2.x版本
$ wget https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/v3.1.3
$ tar -zxvf php-memcached-3.1.3.tar.gz
$ cd php-memcached-3.1.3
$/php7/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
$ ./configure --enable-memcached --enable-memcached-igbinary --with-php-config=/php7/bin/php-config
$ make && make install
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /php7/lib/php/extensions/no-debug-zts-20151012/
$ php7 --ini
Configuration File (php.ini) Path: /php7/etc/
Loaded Configuration File: /php7/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
$ vi /php7/etc/php.ini
extension=memcache.so
extension=/php7/lib/php/extensions/no-debug-zts-20151012/memcached.so
安装igbinary
#wget http://pecl.php.net/get/igbinary-2.0.8.tgz
#tar -zxvf igbinary-2.0.8.tgz
# cd igbinary-2.0.8
# /php7/bin/phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
# ./configure --with-php-config=/php7/bin/php-config
#make && make install
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /php7/lib/php/extensions/no-debug-zts-20151012/
Installing header files: /php7/include/php/
参考http://www.runoob.com/memcached/php-connect-memcached.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论