PHP棘轮:找不到类Memcache
我正在学习Ratchet的教程。对于SessionProvider页面,代码如下所示: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
<?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
(线程安全)扩展。我现在也有同样的问题,如何安装扩展?