Php-Redis configuration and php usage in Ubuntu

Source: Internet
Author: User
Php-Redis configuration in Ubuntu environment and php use getting started php-redis configuration 1. Install the php5-dev (if there is no phpize ), install the php5-devsudoapt-getinstallphp5-dev2, install phpredis to get the latest version code for compiling wget -- no-check-certificatehttp: // github.com/nicolasff

Php-Redis configuration and php usage in Ubuntu

Php-redis Configuration

1. Install php5-dev

(If there is no phpize), install the php5-dev

Sudo apt-get install php5-dev

2. Install phpredis

Obtain the latest version code for compilation

Wget -- no-check-certificate http://github.com/nicolasff/phpredis/tarball/master-O phpredis.tar.gz
Tar phpredis.tar.gz
Cd nicolasff-phpredis-94e0649
Phpize
./Configure
Make
Make install

3. Modify php. ini

Add the redis. so Module

Vim/etc/php5/apache2/php. ini

Vim/etc/php5/cli/php. ini

Add the following line

Extension = redis. so

4. Restart apache

Etc/init. d/apache2 restart

Php usage

$ Redis = new Redis ();
$ Redis-> connect ('2017. 0.0.1 ', 127 );
$ Redis-> set ('key', 'Hello World ');
Echo $ redis-> get ('key ');
?>

Install and test Redis in Ubuntu 14.04Http://www.linuxidc.com/Linux/2014-05/101544.htm

Redis cluster details document http://www.linuxidc.com/Linux/2013-09/90118.htm

Ubuntu 12.10 install Redis (graphic details) + Jedis connection Redis http://www.linuxidc.com/Linux/2013-06/85816.htm

Redis series-installation, deployment, maintenance http://www.linuxidc.com/Linux/2012-12/75627.htm

CentOS 6.3 install Redis http://www.linuxidc.com/Linux/2012-12/75314.htm

Redis installation deployment learning notes http://www.linuxidc.com/Linux/2014-07/104306.htm

Redis configuration file redis. conf detailed description http://www.linuxidc.com/Linux/2013-11/92524.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-07/104652.htm

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.