Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP棘轮:找不到类Memcache_Php_Ratchet - Fatal编程技术网

PHP棘轮:找不到类Memcache

PHP棘轮:找不到类Memcache,php,ratchet,Php,Ratchet,我正在学习Ratchet的教程。对于SessionProvider页面,代码如下所示: <?php // Your shell script use Ratchet\Session\SessionProvider; use Symfony\Component\HttpFoundation\Session\Storage\Handler; use Ratchet\App; $memcache = new Memcache; // Class not found on line 7 $mem

我正在学习Ratchet的教程。对于SessionProvider页面,代码如下所示:

<?php
// Your shell script
use Ratchet\Session\SessionProvider;
use Symfony\Component\HttpFoundation\Session\Storage\Handler;
use Ratchet\App;

$memcache = new Memcache; // Class not found on line 7
$memcache->connect('localhost', 11211);

$session = new SessionProvider(
    new MyApp
  , new Handler\MemcacheSessionHandler($memcache)
);

$server = new App('localhost');
$server->route('/sessDemo', $session);
$server->run();
该服务有两个不同的PHP扩展
memcached

  • memcache

  • memcached
    是否可能在命令行上执行了其中一个脚本,而通过web浏览器执行了另一个脚本?您确实必须将memcache模块添加到PHP CLI中。但是,很抱歉,我不知道如何在Windows/XAMPP上执行此操作。Memcache问题仍然存在。它对答案是开放的。然后你应该用关于你的问题的附加信息更新你的答案。Apache的线程安全扩展,对吗?我现在不能赏金。稍后将尝试:如果您在预工作模式下使用Apache,您可以使用
    nts
    版本,这意味着不是线程安全的,否则使用
    ts
    (线程安全)扩展。我现在也有同样的问题,如何安装扩展?