This article mainly introduces the Php-redis installation test notes, this article explains Redis installation, Redis test, installation Phpredis extension, test Php-redis and so on, the need for friends can refer to the following-->
Back-end development uses PHP operation Redis, where the problems encountered during the installation test are summarized and recorded for future reference! (System for Ubuntu)
Download Address: http://download.redis.io/releases/
1 first open the Redis service-side program
To facilitate testing, we will redis.conf the loglevel and logfile values in the configuration file, as follows:
jay13@ubuntu:/usr/redis$ Redis-server redis.conf
2) Open the Redi client, through the client to the Redis database for the increase and deletion of the search operation. The logs generated during the entire operation can be viewed in/tmp/redis.log.
Take the simplest key operation, for example, with the following example:
3. Install Phpredis Extension
When installing PHP with sudo apt-get install PHP5, Phpize is not installed by default and Phpredis is required when we install phpize, so we need to install Phpize first.
1 we get phpize by installing PHP developer tools. Execute the following command:
You may receive the following error description:The code is as follows:
The use of Apt-get does not fail to install, and we install it by downloading the installation files.
The code is as follows:
After installing the Igbinary, you can install Phpredis with the following command.The code is as follows:
Make && make install
We modified the php.ini configuration file to add the two extensions we just installed to the php.ini file and added the following statement:The code is as follows:
4. Test Php-redis
In the Web page root/var/www/, create a new file test.php, which reads as follows:The code is as follows:
The results are shown below: