

扩展什么的都安装了,
测试代码
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>n";
$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;
$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>n";
$get_result = $memcache->get('key');
echo "Data from the cache:<br/>n";
var_dump($get_result);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
phpinfo()查看扩展是否正确加载
可以使用这个命令,看看拓展是否加载。你这个情况肯定是拓展加载失败了。