CentOS PHP Redis Extended installation Configuration 3 ways

Source: Internet
Author: User
Tags benchmark fpm pack php redis redis redis version centos redis server

Method One

1. Download PHP Redis Expansion pack

The code is as follows Copy Code

#wget http://redis.googlecode.com/files/redis-2.4.4.tar.gz

2 TAR-ZXVF uncompressed package, CD/expansion pack (
Go into the expansion pack and run Phpize is the directory of phpize in my environment,
/usr/local/php/bin/phpize (be sure to run in the expansion pack directory or you will get an error)

3

The code is as follows Copy Code
./configure–with-php-config=/usr/local/php/bin/php-config
Make && make install

4 Modify php.ini Add extension= ' redis.so '

5 Restart Phpservicce Phpfpm-restart
Apache Restart httpd


Method Two

Installation steps:
Download Redis PHP Extensions: https://github.com/owlient/phpredis/downloads

The code is as follows Copy Code

# wget Https://github.com/owlient/phpredis/tarball/master
# MV Master redis-php.tar.gz
# TAR-ZXVF Owlient-phpredis-2.1.1-1-g90ecd17.tar.gz
# CD OWLIENT-PHPREDIS-90ECD17
#/usr/local/php/bin/phpize

#./configure--with-php-config=/usr/local/php/bin/php-config
# Make && make install
#PHP-FPM State Management:/ETC/INIT.D/PHP-FPM {start|stop|quit|restart|reload|logrotate}//Reboot PHP

Compilation results:
Build complete.
Don ' t forget to run ' make test '.

Installing Shared extensions:/usr/lib/php/modules/
# Vim/etc/php.ini
On the last line add: Extension = redis.so
# Service httpd Restart


method Three,

The CentOS version is 6.2 and the Redis version is 2.4.10.

First download the latest stable version of Reids from Redis's official website, address: http://redis.io/download

The following installation steps are then performed, and the operation is very simple.

The code is as follows Copy Code
$ wget http://redis.googlecode.com/files/redis-2.4.10.tar.gz
$ tar xzf redis-2.4.10.tar.gz
$ CD redis-2.4.10
$ make
$ make Test
$ make Install

There are some problems with make test, and you need to Tcl8.5 the library, go to the website http://www.tcl.tk/download it and install it:

The code is as follows Copy Code
$ CD Tcl8.5.0/unix
$ Configure Options
$ make
$ make Test
$ make Install

After that, you can successfully pass the make Test Redis, and performing the Redis made install actually performs the copy operation:

The code is as follows Copy Code
$ mkdir-p/usr/local/bin
$ CP-PF Redis-server/usr/local/bin
$ CP-PF Redis-benchmark/usr/local/bin
$ CP-PF Redis-cli/usr/local/bin
$ CP-PF Redis-check-dump/usr/local/bin
$ CP-PF Redis-check-aof/usr/local/bin

In this way, the Redis was installed successfully!

The next step is to start the Redis, and the compiled executable files are copied to the/usr/local/bin directory, and their roles are:

Daemon startup program for Redis-server:redis server

Redis-cli:redis Command line Operation tool. Of course, you can also use Telnet to operate on its plain text protocol.

Redis-benchmark:redis Performance Testing tool to test Redis performance in your system and your configuration

Starting the Redis process requires only the execution of this/usr/local/bin/redis-server/path-to/redis.conf

Start the time to keep up with the Redis configuration file, so that the Redis on the smooth start.

Next need to install is the PHP redis extension, link address: Nicolasff/phpredis GitHub

Down after decompression, and then start executing the shell below

$/usr/local/php/bin/phpize
#这个phpize是安装php模块的
$./configure--with-php-config=/usr/local/php/bin/php-config
#这个路径根据实际你环境情况进行修改
$ make && make install
After that, a/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/redis.so is generated under this directory

Next, add extension=redis.so to the php.ini.

So that we can officially start to develop ...

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.