我正在关注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();
Run Code Online (Sandbox Code Playgroud)
当我在以下位置运行脚本时,PHP会抛出致命错误command-line:
在第7行找不到类Memcache
此代码放在bin\chat-server.php中
该类不仅适用于chat-server.php脚本.
| 归档时间: |
|
| 查看次数: |
603 次 |
| 最近记录: |