0

我有一个奇怪的问题,在用户的一个 plesk 帐户中它工作得非常好,但是在同一台服务器上不同的 plesk 帐户相同的代码(以下测试代码)不起作用它只是空白,我完全不知道问题是什么。 ..因为它在其他帐户中有效,有什么想法吗?

$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);
4

1 回答 1

0

我找到了原因,

我在该帐户中将 PHP 作为 FASTCGI 运行,而在另一个帐户中将 PHP 作为 APACHE 模块运行。

于 2013-01-30T04:56:57.717 回答