Reputation: 3100
Here is the code:
$memcache = new Memcache();
$memcache->addServer('127.0.0.1', 11211);
$result = $memcache->get("TEST");
if ($result)
{
echo $result;
}
else
{
echo "TEST key not found, adding key";
if (!$memcache->set("TEST", "Memcache key found. Memcache is working."))
{
echo "could not set memcache key";
}
}
echo "Memcache version: ";
var_dump($memcache->getVersion());
This part results in:
1.2.6
However, the phpinfo says it is 2.2.5:
When I run the command memcached -h
directly on the server, I get 1.2.6
Why is there a difference in version number?
Upvotes: 0
Views: 190
Reputation: 4544
$memcache->getVersion()
returns the version of the server (according to the documentation), while phpinfo()
shows the version of the memcache PHP extension.
Upvotes: 2