Have you seen the difference between memcache and memcached? They are not the same, and if your script with new Memcached
is working, but the one with memcache_get
is not, then you have installed memcached, but not memcache
memcache有错误
I am trying to get someone else's php and yii framework project working. I get this error trying to run one of their files:
Error: Call to undefined function memcache_get() in /var/yaamp/web/yaamp/core/functions/memcache.php:15
That particular section of code looks like this:
public function get($key)
{
return memcache_get($this->memcache, $key);
}
Your initial response may be that memcache isn't installed or not working correctly. But it is working. In my phpinfo() I see a standard entry for memcache. I also created a short php file pasted here that works just fine:
$mem_var = new Memcached();
$mem_var->addServer("127.0.0.1", 11211);
$response = $mem_var->get("Bilbo");
if ($response) {
echo $response;
$mem_var->set("Bilbo", "Sent from memcache") or die("Dead");
} else {
echo "Line 9";
$mem_var->set("Bilbo", "Sent from memcache Line 10") or die("Dead");
}
I am new to memcache and not sure how to debug or fix this. This is ubuntu 16.03, php7 and lighttpd server Any ideas?
- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答
1条回答
为你推荐
- 滑行错误“系统找不到指定的路径”
- 1个回答
- golang远程导入失败
- 2个回答
- PHPUnit分段错误
- php
- 13个回答
- php-fpm错误“没有指定输入文件”与Docker
- memcache有错误
- Yii错误500:php_network_getaddresses:getaddrinfo失败:名称或服务未知
- php
- 1个回答
- 尝试存储阵列时CHDB缓存错误
- php
- 2个回答
- Memcache错误:从流(0)数组读取行失败
- 错误消息“禁止您在另一台PC上没有访问/在此服务器上的权限”
- apache httpd-2.2.17 编译安装 失败
- linux
- 0个回答
- memcached存储session, 无法创建sessionid??
- php
- 1个回答
- thinkphp3.1Call to a member function get() on null
- thinkphp部署到sae的问题
- 1个回答