How to configure redis and enable multi-port services in phpstudy

One: First, install phpstudy on your computer. After opening, enter the software management

If it is not installed, click the install button at the back and wait for a few seconds to succeed.

Two: After the installation is successful, click the Settings button at the back

As you can see, the default port number is 6379. If it is changed to another port, it is to change the default port 6379. This situation applies to the case where port 6379 is occupied, and redis is only used by one site.

We all know that phpstudy can configure multiple sites. If the multiple sites we configure must use redis services, only one default port is obviously unable to meet our needs.

Three: If multiple sites share a redis port service, it will cause redis data confusion. At this time, we need redis to open more ports.

The operation is as follows:

1: Open the local installation directory of phpstudy and find the Extensions folder.

2: Find the plug-in redis directory of phpstudy

3: Find the redis.conf file

 4: Copy the file into a new file and rename it. For the sake of what you see is what you get, assuming that the newly opened port we need is 6380, then we can name it redis6380.conf.

5: Open the redis6380.conf file, and change the port behind the port to 6380 [Here is an example, please change it according to your own needs, remember, the file name is what you see is what you get, the name is 6380, change it here for 6380]

The following passwords can be changed according to project requirements.

 

 6: After the changes are complete, save the file.

7: Click the file path at the top and enter cmd

A command line window opens.

8: Enter the command redis-server redis6380.conf and press Enter to start the redis 6380 port service.

 At this point, the redis 6380 port service has been successfully opened, and you can enter the project for testing.

Note: When using the redis port service, make sure that the command line window is not closed after it is started. If it is closed, the service will also stop.

 When you need to configure other port services, copy redis.conf, modify the port number and password, rename the file WYSIWYG, open a new command line window through cmd, and use redis-server redis****.conf to start the service. Can. 【***Change to the port you need.

 

Guess you like

Origin blog.csdn.net/salestina/article/details/124665914