解决php-memcache set,用python-memcache get报错的问题
2015-03-23 21:26
561 查看
最近项目需要,在web端用php进行memcache的操作,后台有个python脚本需要去拿memcache里的数据。于是出现报错如下:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/memcache.py", line 898, in get
File "build/bdist.linux-x86_64/egg/memcache.py", line 882, in _get
File "build/bdist.linux-x86_64/egg/memcache.py", line 871, in _unsafe_get
File "build/bdist.linux-x86_64/egg/memcache.py", line 1034, in _recv_value
UnboundLocalError: local variable 'val' referenced before assignmen
google了一把,查到时python-memcached的一个bug
https://blog.serverdensity.com/notes-on-using-memcached-through-php-and-python/
经过实验,如果是php-memcache版本是2.2的时候,python-memcache可以正常使用
如果是3.+ 就会出现上面的报错。
解决方法,装另外的python-pylibmc插件,可以很好的解决,
安装教程在这里
http://jfreebird.iteye.com/blog/936889
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/memcache.py", line 898, in get
File "build/bdist.linux-x86_64/egg/memcache.py", line 882, in _get
File "build/bdist.linux-x86_64/egg/memcache.py", line 871, in _unsafe_get
File "build/bdist.linux-x86_64/egg/memcache.py", line 1034, in _recv_value
UnboundLocalError: local variable 'val' referenced before assignmen
google了一把,查到时python-memcached的一个bug
https://blog.serverdensity.com/notes-on-using-memcached-through-php-and-python/
经过实验,如果是php-memcache版本是2.2的时候,python-memcache可以正常使用
如果是3.+ 就会出现上面的报错。
解决方法,装另外的python-pylibmc插件,可以很好的解决,
安装教程在这里
http://jfreebird.iteye.com/blog/936889
相关文章推荐
- 关于php页面最大执行时间问题(set_time_limit函数在windows下不起作用的解决)
- 转 memcache保存php的session 解决多服务器的session问题
- PHP引号转义中解决POST,GET,Mysql数据自动转义问题
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- 解决安装python第三方模块 '-mno-cygwin'报错的问题
- PHP_NETWORK_GETADDRESSES: GETADDRINFO FAILED问题解决办法
- base.set_Item base.get_Item导致无法编译问题解决方法
- 解决hibernate产生的id序列或者setXX不能同步到数据库到问题(this.hibernateTemplate.flush();hibernateTemplate.getSessionFactory().getCurrentSession().connection().commit())
- PHP引号转义中解决POST,GET,Mysql数据自动转义问题
- PHP 解决nginx 用file_get_content 问题
- 关于php页面最大执行时间问题(set_time_limit函数在windows下不起作用的解决)
- jq的get传参数在utf-8中乱码问题的解决php版
- 关于php页面最大执行时间问题(set_time_limit函数在windows下不起作用的解决)
- date_default_timezone_set()问题解决方案(PHP5.3以上的)
- 解决PHP中file_get_contents抓取网页中文乱码问题
- PHP 5.3 ereg()报错的问题解决
- CentOS(x86_64)下PHP安装memcache扩展问题解决方法分享
- 编译安装apache+php,以及安装过程中的报错问题解决
- PHP_NETWORK_GETADDRESSES: GETADDRINFO FAILED问题解决办法