Home Backend Development PHP Tutorial yii --memcached cache configuration_PHP tutorial

yii --memcached cache configuration_PHP tutorial

Jul 14, 2016 am 10:09 AM
cmd yii Command Line start Open of cache enter run Configuration

Start->Run->Enter cmd, open memcached.exe on the command line, and enter the folder where it is located. Enter: memcached.exe -d install to install
Enter memcached.exe -d start to start

Open the yii configuration file: config/main.php and add under components:
[html]
'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,                               ),
),
),

'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,
),
),
),

Use:
[html]
Yii::app()->memcache->get(id);
Yii::app()->memcache->set(id,value,time);

Yii::app()->memcache->get(id);
Yii::app()->memcache->set(id,value,time);




http://www.bkjia.com/PHPjc/477582.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/477582.html

Start-Run-enter cmd, open memcached.exe on the command line, in the folder where it is located, enter: memcached.exe - d install Install and enter memcached.exe -d start to start and open the yii configuration file: conf...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to execute .sh file in Linux system? How to execute .sh file in Linux system? Mar 14, 2024 pm 06:42 PM

How to execute .sh file in Linux system? In Linux systems, a .sh file is a file called a Shell script, which is used to execute a series of commands. Executing .sh files is a very common operation. This article will introduce how to execute .sh files in Linux systems and provide specific code examples. Method 1: Use an absolute path to execute a .sh file. To execute a .sh file in a Linux system, you can use an absolute path to specify the location of the file. The following are the specific steps: Open the terminal

Where can I open the Douyin mini game? Two ways to open Douyin mini games Where can I open the Douyin mini game? Two ways to open Douyin mini games Mar 15, 2024 am 09:30 AM

Douyin is a popular short video social application. Users can not only watch and share various types of short video content, but also provide a series of mini games for you to play. So where can I get into Douyin mini-games? Where is the entrance to Douyin mini game? Let’s take a look at the detailed tutorial below. Method 1: Open the mini program 1. Click the My option. After entering the homepage of Douyin, click the My option to enter. 2. Click the three horizontal lines. After entering the My interface, click the three horizontal lines button above. 3. Click on the mini program. After opening the three horizontal lines option, click on the mini program inside. 4. Click on the Douyin Mini Game. After entering the mini program interface, click on the Douyin Mini Game option to open it. Method 2: Search and open 1. Click the magnifying glass to enter

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to turn off Bitlocker encryption using CMD at the command prompt How to turn off Bitlocker encryption using CMD at the command prompt Jun 19, 2024 am 11:33 AM

Enter the following command in the administrator command prompt to turn off manage-bde-offC: But sometimes the following prompt appears: Error - This volume stores one or more external keys that can automatically unlock other volumes. This type of key must first be deleted before this volume can be unlocked. At this time, you need to execute the following command first: (If the system partition is not C, change the drive letter below) manage-bde-autounlock-ClearAllKeysc: Error 2: This operation cannot be performed because the volume is locked. manage-bde-unlockc:-rp123456789012345678901234567890123456789012345678 Note:

Upgrade Ubuntu 20.04 to 22.04 via command line Upgrade Ubuntu 20.04 to 22.04 via command line Mar 20, 2024 pm 01:25 PM

This article details the steps to upgrade Ubuntu 20.04 to 22.04. For users using Ubuntu 20.04, they have missed the new features and advantages brought by version 22.04. In order to get a better experience and security, it is recommended to upgrade to a newer Ubuntu version in time. Ubuntu22.04 is codenamed "Jamie Jellyfish", let's explore how to get the latest LTS version! How to upgrade Ubuntu 20.04 to 22.04 via the command line Mastering the command line will give you an advantage. While it is possible to update Ubuntu via the GUI, our focus will be via the command line. First, let’s check the currently running version of Ubuntu using the following command: $

Differences and similarities of cmd commands in Linux and Windows systems Differences and similarities of cmd commands in Linux and Windows systems Mar 15, 2024 am 08:12 AM

Linux and Windows are two common operating systems, representing the open source Linux system and the commercial Windows system respectively. In both operating systems, there is a command line interface for users to interact with the operating system. In Linux systems, users use the Shell command line, while in Windows systems, users use the cmd command line. The Shell command line in Linux system is a very powerful tool that can complete almost all system management tasks.

Where to open win8 running Where to open win8 running Mar 20, 2024 pm 03:46 PM

There are three ways to open the Run dialog: using the Win + R shortcut, through the search function, or by typing "Run" directly in the Start screen.

Essential PHP programs: Install these to run smoothly! Essential PHP programs: Install these to run smoothly! Mar 27, 2024 pm 05:54 PM

Essential PHP programs: Install these to run smoothly! PHP is a popular server-side scripting language that is widely used to develop web applications. To successfully run a PHP program, you first need to install some necessary software and tools on the server. In this article, we will introduce the software and tools that must be installed, along with specific code examples to help you run PHP programs smoothly. 1. PHP interpreter The core of the PHP program is the PHP interpreter, which is responsible for parsing and executing PHP code. To install the PHP interpreter, you can follow

See all articles