dqnqpqv3841 2013-06-29 09:56
浏览 43
已采纳

如何在Windows中的wamp中启用memcached?

Iam running WAMP server and just enabled php_memcache extension and have tried the code

<?php
    $memcache = new Memcache;
    $memcache->connect('localhost', 11211) or die ("Could not connect");

    $version = $memcache->getVersion();
    echo "Server's version: ".$version."<br/>
";

    $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/>
";

    $get_result = $memcache->get('key');
    echo "Data from the cache:<br/>
";

    var_dump($get_result);
?>
  • 写回答

1条回答 默认 最新

  • dongmo9996 2013-07-01 14:25
    关注

    It looks like you are trying to connect MySql server without installing it. First you have to install a memcached server. You can use couchbase server with memcache bucket on Windows. IMHO it's the best port for Windows OS.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真