PHP棘轮:Class Memcache找不到
问题描述:
我正在关注Ratchet的教程。对于SessionProvider页,代码是这样的:PHP棘轮:Class Memcache找不到
<?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抛出一个致命的错误,当我运行在command-line
脚本:
类Memcache中未发现第7行
此代码被置于bin \ chat-server.php中
Wierd Stuff
该类不适用于chat-server.php
脚本。
有没有可能是你执行的命令行脚本,另一个通过网页浏览器中的一个? – lxg
您必须确实将memcache模块添加到PHP CLI。但是,对不起,我不知道如何在Windows/XAMPP上执行此操作。 – lxg
Memcache问题仍然存在。它是开放的答案。 –