PHP Technology Group 170855791
PHP has multiple Redis extensions, and I am using the Phpredis extension
Download extension Phpredis First, download address: Https://github.com/nicolasff/phpredis
Can install extensions after decompression
Enter the Phpredis directory and execute the following command:
Phpize./configuremake && make Install
Note: The phpize command is stored under the Bin folder of the PHP installation file, as my PHP is installed in the/usr/local/php folder, you can use the command
/usr/local/php/bin/phpize./configuremake && make Install
After executing the command will automatically copy the generated redis.so file to the PHP directory, only need to modify the PHP configuration file can be, add the following specified in the PHP configuration file
Extension=redis.so
Re-launch Apache
View Phpinfo (), including Redis, stating that the configuration was successful
Phpredis supports session management and can tell Redis how to store the session by modifying the PHP configuration file
Session.save_handler = Redissession.save_path = "Tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout= 2.5, tcp://host3:6379?weight=2 "