1. Download the extension installation package
wget https://github.com/nicolasff/phpredis/downloads
2. Unzip
TAR-ZXVF nicolasff-phpredis-2.1.3-124-gd4ad907.tar.gz
3. Enter the extracted file (generate configure file)
/phpstudy/server/php/bin/phpize
4. Configure PHP
./configure--with-php-config=/phpstudy/server/php/bin/php-config
5. Compiling the installation
Make && make install
6. Configure PHP.ini
Vi/phpstudy/server/php/lib/php.ini
(Join: extension=redis.so)
- Restart Apache or nginx (direct restart phpstudy more convenient: phpstudy restart)
- To the normal situation, you can see the Redis extension with Phpinfo
- If Phpinfo does not have Redis extension information, add/etc/php.d/redis.ini (path is my local)
- Redis.ini content is as follows:
- ; Enable MySQL Extension module
- Extension=redis.so
- Restart Apache or nginx (direct restart phpstudy more convenient: phpstudy restart)
Linux Installation Phpredis Extensions