Install Redis extension in PHP in Linux-php Tutorial

Source: Internet
Author: User
Tags php redis redis version zts
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.