In Linux, Redis is installed in PHP. extended classification: PHP Time: October 13, March 8, 2015
Pecl.php.net, the PECL Library is a PHP extension that provides all known extensions and hosting devices of a directory to Download PHP extensions. many extensions of PHP can be found here. Today, PHP programmer Lei Xuesong mainly explains how to install redis extension in php in Linux, and how to install redis extension in windows.
1, PHP redis: http://pecl.php.net/package/redis
[root@Redis ~]# wget http://pecl.php.net/get/redis-2.2.7.tgz
2. unzip the package and enter the Redis directory.
[root@Redis ~]# tar xzf redis-2.2.5.tgz [root@Redis ~]# cd redis-2.2.5
3. Generate the configure configuration file in the Redis folder.
[Root @ Redis redis-2.2.5] #/usr/local/php/bin/phpize indexing ING for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 [root @ Redis redis-2.2.5] #. /configure -- with-php-config =/usr/local/php/bin/php-config [root @ Redis redis-2.2.5] # make [root @ Redis redis-2.2.5] # make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-2009062 6/cp: cannot create regular file '/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/# INST @ 6338 #': Permission denied make: * ** [install-modules] Error 1 Note: You must use the root user. [Root @ Redis redis-2.2.5] # su Password: [root @ web redis-2.2.5] # make install
4. load the Redis extension in the PHP configuration file php. ini.
extension=redis.so
5. check whether phpinfo and Redis extensions are loaded.
Redis
Redis Support enabled
Redis Version 2.2.5
Now, the Redis extension has been installed successfully and loaded. you can use PHP to operate Redis.
Appendix:
Installing the Redis extension in windows is easier. find the corresponding version, download the dll file, put it in ext under the PHP directory, and modify the PHP configuration file php. ini, load extension = php_redis.dll, restart Apache, and check whether Redis exists in phpinfo. if Yes, congratulations, the installation is successful, and that's easy.
For details about the differences between PHP VC6, VC9, TS, and CNT versions, refer to the differences and usage of PHP versions.