Home > Database > Redis > How to add redis to php's Yii framework

How to add redis to php's Yii framework

王林
Release: 2023-05-26 10:31:06
forward
1535 people have browsed it

1. Download the Rediscache plug-in

Extract the plug-in to helloyii/app/protected/extensions:

The location of the plug-in file after deployment should be: helloyii/ app/protected/extensions/redis/CredisCache.php

Add the yii-redis component in yii’s web.php configuration file

2. Install the redis extension of yii2

cd /www/html/basic
php composer.phar require --prefer-dist yiisoft/yii2-redis
Copy after login

3. Add the yii-redis component to the yii web.php configuration file

In the yii config directory, edit web.php and go to components Plus:

  'redis' => [
                'class' => 'yii\redis\Connection',
                'hostname' => 'localhost',
                'port' => 6379,
                'database' => 0,
        ],
Copy after login

What are the PHP development environment building tools?

1. phpStudy is the most commonly used development environment for novices to get started.

2. WampServer, WampServer is also as simple to operate as phpStudy and is more friendly to novices.

3. XAMPP, XAMPP (Apache MySQL PHP PERL) is a powerful integrated website building software package;

4. MAMP, MAMP is divided into two types: MAMP and MAMP Pro for Mac.

5. Pagoda Panel, Pagoda Panel is a server management software that supports Windows and Linux systems.

6. UPUPW, UPUPW is currently the most distinctive web server PHP suite under the Windows platform.

The above is the detailed content of How to add redis to php's Yii framework. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template