Php-redis Installation Notes

Source: Internet
Author: User

Redis source code Download: http://redis.io/download

Php-redis Source Download: Https://pecl.php.net/package/redis

Or: Https://github.com/owlient/phpredis/tarball/master

Unzip the basic installation of Redis source code see./readme

CP redis.conf/etc  #复制配置文件

New user (can be ignored) and create the appropriate folder:

-P/var/lib/-P/var/log//var/lib//var/log/redis

Service script:

chmod +x/etc/init.d/redis

Content:

########################## #PATH=/usr/local/bin:/sbin:/usr/bin:/bin Redisport=6379EXEC=/usr/local/bin/redis-serverredis_cli=/usr/local/bin/redis-CLI Pidfile=/var/run/redis.pidconf="/etc/redis.conf"    Case " $" inchstart)if[ -F $PIDFILE] then echo"$PIDFILE exists, process is already running or crashed"        ElseEcho"starting Redis Server ..."$EXEC $CONF fiif["$?"="0"] then echo"Redis is running ..."fi;; Stop)if[ ! -F $PIDFILE] then echo"$PIDFILE does not exist, process was not running"        ElsePID=$ (cat $PIDFILE) echo"stopping ..."$REDIS _cli-P $REDISPORT SHUTDOWN while[ -x ${pidfile}] DoEcho"waiting for Redis to shutdown ..."Sleep1Done Echo"Redis stopped"fi;; Restart|force-Reload) ${0} stop ${0} start; *) echo"Usage:/etc/init.d/redis {start|stop|restart|force-reload}">&2Exit1esac##############################

To make Redis daemon run in the future, you need to modify the redis.conf:

Change Daemonize No to daemonize Yes

End Redis installation After starting a service test

Continue Php-redis Installation :

Decompression Php-redis source code after entering the directory,

Use Phpize to build a PHP plug-in module:

The compiled and installed PHP needs to find the Phpize path to execute in the Php-redis source directory, for example:

If the installation of Yum, CentOS needs Php-devel,ubuntu need Php5-dev

Also execute phpize command in Php-redis source directory

Compile after execution:

./configure--with-php-config=/usr/local/php/bin/php-config #phpinfo看下自己的php配置文件路径
Make && make install #成功后注意查看so文件的存放目录

Add Configuration in PHP.ini:

Extension=redis.so #注意路径

Restart the HTTP service software, view phpinfo, complete.

End.

Php-redis Installation Notes

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.