Redis services and installation of Phpredis extensions

Source: Internet
Author: User
Tags download redis mkdir redis

Http://www.cnblogs.com/ryanlamp/p/6385452.html


A. Download package

Download Redis wget http://download.redis.io/releases/redis-3.0.7.tar.gz

Download the redis PHP extension wget http://pecl.php.net/get/redis-3.1.1.tgz

two. Installation of Redis service

CD redis-3.0.7

Make

Executes the make command, and the output of the last few lines

Hint:to run ' make test ' was a good idea;)

Execute installation command

Make install

Tip: cd src && make install make[1]: Entering directory '/home/pengyudi/redis-3.0.7/src ' hint:to run ' make TES   T ' is a good idea;) INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL make[1]: Leaving directory '/hom E/pengyudi/redis-3.0.7/src '

Follow the prompts: cd src && make install
Tip: hint:to run ' make test ' was a good idea;) INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL INSTALL instal

Follow the prompts: Make test for need TCL 8.5 or newer in order to run the Redis test make: * * * [Test] Error 1

Workaround reference: http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html

can also be used: Yum install TCL command installation

It was found that the search did not need to be installed, directly to the SRC directory to execute./redis-server can

After make is successful, there will be more executable files in the SRC directory: Redis-server,redis-cli and so on.

The CP command is used to copy to the USR directory for easy operation.

CP redis-server/usr/local/bin/

CP redis-cli/usr/local/bin/

Then create a new directory to store the configuration file

Mkdir/etc/redis

Mkdir/var/redis

Mkdir/var/redis/log

Mkdir/var/redis/run

mkdir/var/redis/6379

Locate the profile template in the Redis solution directory and copy to the following location.

CP redis.conf/etc/redis/6379.conf

Modify via VIM command

Daemonize Yes

Pidfile/var/redis/run/redis_6379.pid

Logfile/var/redis/log/redis_6379.log

dir/var/redis/6379

Last Run Redis:

$/usr/local/bin/redis-server/etc/redis/6379.conf

Execute/USR/LOCAL/BIN/REDIS-CLI Success

Exceptions that may occur during the period:

Exception One:

MAKE[2]: Cc:command not found

Exception reason: GCC not installed

Solution: Yum Install gcc-c++

Exception Two:

Zmalloc.h:51:31:error:jemalloc/jemalloc.h:no such file or directory

Cause of the exception: some compilation dependencies or legacy problems with the original compilation

Solution: Make Distclean. Clean it up and make it again.

After make is successful, make test is required. An exception occurred in make test.

Exception One:

Couldn ' t execute "tclsh8.5": No such file or directory

Exception reason: Tcl not installed

Solution: Yum install-y tcl.

three. Install Phpredis extension

Extract redis-3.1.1.tgz files and go to directory

Locate the Phpize location of this environment (locate phpize)

Execute sudo/usr/bin/phpize (Generate configure etc files)

Find the location of Php-config

Executing sudo./configure--with-php-config=/usr/bin/php-config will eventually see the following results

Perform sudo make

If you receive the following error

It may be that the Phpredis version is a bit low, you can go to Http://pecl.php.net/package/redis to download the latest try

If the following results appear

Indicates that the installation is normal

Follow the instructions to perform sudo make test

sudo make install

Modify PHP.ini

Find the php.ini files used in this environment

My environment is/etc/php.ini.

Add extension = redis.so

Restart HTTP

sudo service httpd restart

Verify that the Redis extension has been installed successfully by Phpinfo ()


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.