国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

Memcached存儲如何調(diào)用

laoyao

做開發(fā)的時(shí)候用到了緩存,而在做緩存配置的時(shí)候發(fā)現(xiàn)現(xiàn)在原來關(guān)于store文件配置的說明文檔在WorkerMan 3.x 手冊沒有了( http://doc.workerman.net/start/store_config.html ),找到了一篇之前關(guān)于Memcached調(diào)用的文章( http://wenda.workerman.net/?/question/69 )卻發(fā)現(xiàn)按照這樣的配置無法調(diào)用,報(bào)錯信息為:

/*------------------------------------------------------------------------------------------------------------------------------
Fatal error: Uncaught Error: Class 'Store' not found in C:\wamp64\www\workerman-
todpole-for-win-master\Applications\Timer\Events.php:82
Stack trace:
#0 : Events::onWorkerStart(Object(GatewayWorker\BusinessWorke
r))
#1 C:\wamp64\www\workerman-todpole-for-win-master\GatewayWorker\BusinessWorker.p
hp(195): call_user_func('Events::onWorke...', Object(GatewayWorker\BusinessWorke
r))
#2 : GatewayWorker\BusinessWorker->onWorkerStart(Object(Gatew
ayWorker\BusinessWorker))
#3 C:\wamp64\www\workerman-todpole-for-win-master\Workerman\Worker.php(741): cal
l_user_func(Array, Object(GatewayWorker\BusinessWorker))
#4 C:\wamp64\www\workerman-todpole-for-win-master\GatewayWorker\BusinessWorker.p
hp(174): Workerman\Worker->run()
#5 C:\wamp64\www\workerman-todpole-for-win-master\Workerman\Worker.php(433): Gat
ewayWorker\BusinessWorker->run()
--------------------------------------------------------------------------------------------------------------------------------*/

而后來我又換了一種方式,直接初始化緩存對象的方式來調(diào)用

/*------------------------------------------------------------
//創(chuàng)建memcache對象
$mem = new Memcache;

//連接memcache服務(wù)器
$mem -> connect("localhost", 11211);
 ------------------------------------------------------------*/
結(jié)果出現(xiàn)了同樣的報(bào)錯,無法找到Memcached
/*-------------------------------------------------------------------------------------------------------------------------------
Fatal error: Uncaught Error: Class 'Memcache' not found in C:\wamp64\www\workerm
an-todpole-for-win-master\Applications\Timer\Events.php:85
Stack trace:
#0 : Events::onWorkerStart(Object(GatewayWorker\BusinessWorke
r))
#1 C:\wamp64\www\workerman-todpole-for-win-master\GatewayWorker\BusinessWorker.p
hp(195): call_user_func('Events::onWorke...', Object(GatewayWorker\BusinessWorke
r))
#2 : GatewayWorker\BusinessWorker->onWorkerStart(Object(Gatew
ayWorker\BusinessWorker))
#3 C:\wamp64\www\workerman-todpole-for-win-master\Workerman\Worker.php(741): cal
l_user_func(Array, Object(GatewayWorker\BusinessWorker))
#4 C:\wamp64\www\workerman-todpole-for-win-master\GatewayWorker\BusinessWorker.p
hp(174): Workerman\Worker->run()
-----------------------------------------------------------------------------------------------------------------------------*/

想問兩個問題:
1.如何正確調(diào)用Memcached

如何直接使用php提供的原生的memcache接口
還望worker大大給解答一下
(運(yùn)行環(huán)境:WIN7 64 已安裝Memcached擴(kuò)展且用PHPdemo運(yùn)行成功。)

4007 1 0
1個回答

walkor 打賞

這個看PHP手冊就行了。workerman里使用memcache redis mysql等擴(kuò)展沒有限制。
http://php.net/manual/zh/book.memcached.php

  • 暫無評論
年代過于久遠(yuǎn),無法發(fā)表回答
??