简体   繁体   中英

PHP - Memcache working in one plesk account other doeest work ..?

I have strange problem, in one plesk account for the user it works perfectly fine, but in the same server different plesk account same code (following test code) doesnt work it just comes as blank, i have absolutely no idea what the problem is ... as it works in the other account any ideas ?

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

I found the reason,

I was running PHP as FASTCGI in that account while i was running PHP as a APACHE module in the other one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM