ubuntu14-04 Installing Redis and Php5-redis extensions

Source: Internet
Author: User
Tags php redis phpinfo

PS: After the system is installed, it is best to perform the following commands to update the software

In fact, as long as the software source is no problem, install what software is OK.

To start installing Redis ~ ~

A: If your other is OK, you can execute the following command to install directly

sudo apt-get install Php5-redis

This is the ideal way to install and the easiest way

However, there are eight or nine of life's disappointments.

such as what can not find the installation package Ah, such as the lack of any dependence ah

It's going to be a little trouble.

Two: To die, trouble to die, of course, this is geek spirit

1. Installation of Redis service

In general, the above Redis-server is able to install correctly, I am anyway this installation.
If it's not, you can refer to this article on Oschina.

After the installation is complete, you can

See if the Redis service is started

     sudo service redis-server start

If it starts, then you can

Enter the Redis command line (127.0.0.1:6379: > Just like this), you can enjoy the fun, but not PHP together you are sure you can play very much, or delay a few minutes to install a PHP extension bar
2. Install PHP extensions

Decompression: Unzip Php-redis.zip
Run: Phpize (PS: This is a tool for compiling extensions under Php-dev, if not, quickly perform sudo apt-get install Php-dev installation)
Generate shared libraries (such as redis.so): Make

Command line prompt to execute "make test", although not necessary, but careful to sail the boat AH ~ Brother!! If there's no problem here, let's move on.

The end result is that the software has been installed in/usr/lib/php5/20121212/redis.so, the essence of which is to copy the shared library files that we generated earlier, and so on.

Wait a moment, but, now the problem is, how to let him and PHP together, if you will lose PHP, you should test now Php-redis extension in <?php phpinfo (),?> generated page shows the Redis extension, There is no installation of the words are not, hehe.

This configuration is very troublesome, do not want to CentOS and other Linux directly in the php.ini file and add extension=redis.so on the line, do not know that the design of Ubuntu such a death is not the same as the Apache environment is what intentions ah, I have been here to toss a time. Hey...

First create a new Redis.ini file in/etc/php5/mods-available/, write the following, as to why you can refer to the same directory of other such as php-mysql extension situation

; Configuration for PHP Redis module; Priority=20extension=redis.so

Simply put the location is not the same, and each extension of the configuration is independent

Now restart Apache and reload just that page to see if the extension has no, don't doubt, of course you did, and I was depressed at the moment

Then found their discussion on Oschina, as if to create a link to a configured file like this:

Then the file in the back link to the previous one you just wrote the configuration file, you can also

The ability to see links to other profiles in that directory, just a few of the names on the file, I'm also naming them.

Now restart Apache, try ~ ~

What, you will not restart, and I have been speaking for a half a day, yes! You put the following command upside down, you are a day how boring ah!

You should now see the installation information for the Redis extension on the Phpinfo page.

ubuntu14-04 Installing Redis and Php5-redis extensions

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.