我正在关注 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 抛出致命错误command-line
:
第 7 行中未找到 Memcache 类
这段代码放在 bin\chat-server.php 中
奇怪的东西
该课程不仅适用于chat-server.php
script.
那里有两个distinct服务的 PHP 扩展memcached
:
看起来您已经安装了后一个,而您的应用程序需要第一个。
您可以找到适合 Windows 的扩展here http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)