This article mainly introduces Php-Redis installation test notes. This article explains redis installation, redis testing, installing phpredis extension, and testing php- For redis and other content, friends who need it can refer to it
Back-end development uses PHP to operate redis. Here, we will summarize and record the problems encountered during the installation and testing process for future reference! (The system is ubuntu)
1.redis installation
Download address: http://download.redis.io/releases/
Unzip and install:
The code is as follows:
The code is as follows:
2.redis test
1) First open the redis server program
To facilitate testing, we modified the values of loglevel and logfile in the redis.conf configuration file as follows:
loglevel debug
logfile “/tmp/redis.log”
jay13@ubuntu:/usr/redis$ redis-server redis.conf
2) Open the redi client and perform addition, deletion, modification and query operations in the redis database through the client. The logs generated during the entire operation can be viewed in /tmp/redis.log.
Taking the simplest key operation as an example, the example is as follows:
The code is as follows:
3. Install phpredis extension
When using sudo apt-get install php5 to install php, phpize is not installed by default. When we install phpredis, we need to use phpize, so we need to install phpize first.
1) We get phpize by installing php developer tools. Just execute the following command:
The code is as follows:
The code is as follows:
The following error description may appear:
The code is as follows:
The installation cannot be completed using apt-get. We install it by downloading the installation file.
The code is as follows: