The example in this article describes how to configure and use memcached cache in Yii. Share it with everyone for your reference, the details are as follows:
1. Download the memcached software package, unzip it, and put memcached.exe in any place, such as: d:/memcached/.
2. Start->Run->Enter cmd, open memcached.exe on the command line, in the folder where it is located, enter: memcached.exe -d install Installation
3. Enter memcached. exe -d start Start
4. Add extension=php_memcache.dll.
5. Open the yii configuration file: config/main.php, and add under components:
'memcache'=>array( 'class'=>'CMemCache', 'servers'=>array( array( 'host'=>'127.0.0.1', 'port'=>11211, 'weight'=>60, ), array( 'host'=>'127.0.0.1', 'port'=>11211, 'weight'=>40, ), ), ),
6. Use:
Yii::app()->memcache->get(id); Yii::app()->memcache->set(id,value,time);
I hope this article will help everyone based on Yii Frameworks for PHP programming help.
For more articles related to Yii configuration and using memcached cache, please pay attention to the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools
