Redis and Phpredis extended installation under Linux

Source: Internet
Author: User
Tags zts redis server

++++++++++++++++++++++++++++++++++++++++++++++
Redis and Phpredis extended installation under Linux
++++++++++++++++++++++++++++++++++++++++++++++
Operating system: [CentOS6.0]
Redis: [redis-2.4.3]
Phpredis: [phpredis-2.1.0]
++++++++++++++++++++++++++++++++++++++++++++++
Preparing to install the software (download)
1> [Redis]
Http://redis.googlecode.com/files/redis-2.4.3.tar.gz
2> [Phpredis]
Https://github.com/owlient/phpredis/tarball/master
++++++++++++++++++++++++++++++++++++++++++++++

1> "Installing Redis server"

[HTML]View Plaincopy
  1. TAR-ZXVF redis-2.4.3.tar.gz
  2. Cp-r Redis-2.4.3/usr/local/redis
  3. Cd/usr/local/redis
  4. Make
  5. Make install
  6. CP redis.conf/etc/
  7. #修改redis. conf
  8. Vi/etc/redis.conf
  9. #查找daemonize no change to
  10. #以守护进程方式运行
  11. Daemonize Yes
  12. #修改dir./is an absolute path,
  13. #默认的话redis-server is generated or read Dump.rdb in the current directory when it starts
  14. #所以如果在根目录下执行redis-server/etc/redis.conf's words,
  15. #读取的是根目录下的dump. RDB, in order for the Redis-server to be executed in any directory
  16. #所以此处将dir改为绝对路径
  17. Dir/usr/local/redis
  18. #修改appendonly为yes
  19. #指定是否在每次更新操作后进行日志记录,
  20. #Redis在默认情况下是异步的把数据写入磁盘,
  21. #如果不开启, it may result in loss of data over a period of time when power is lost.
  22. #因为 the Redis itself synchronizes data files by the save conditions above,
  23. #所以有的数据会在一段时间内只存在于内存中. Default is No
  24. AppendOnly Yes
  25. #将redis添加到自启动中
  26. echo "/usr/local/bin/redis-server/etc/redis.conf" >>/etc/rc.d/rc.local
  27. #启动redis
  28. Redis-server/etc/redis.conf
  29. #查看redis是否己启动
  30. Ps-ef | grep Redis

2> "Open Redis port"

[HTML]View Plaincopy
    1. #关闭防火墙
    2. Service Iptables Stop
    3. Vi/etc/sysconfig/iptables
    4. #添加
    5. -A input-m state--state new-m tcp-p TCP--dport 6379-j ACCEPT
    6. #重启防火墙
    7. Service Iptables Restart

3> "Installing Phpredis extensions"

[HTML]View Plaincopy
    1. TAR-ZXVF owlient-phpredis-2.1.1-1-g90ecd17.tar.gz
    2. CD OWLIENT-PHPREDIS-90ECD17
    3. /usr/local/php/bin/phpize
    4. ./configure --with-php-config=/usr/local/php/bin/php-config
    5. Make
    6. Make install
    7. #执行完make Install will generate
    8. #Installing Shared extensions:/usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/
    9. #修改php. ini
    10. Vi/usr/local/php/etc/php.ini
    11. #查找extension_dir, modified to
    12. Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
    13. #添加redis
    14. Extension = redis.so
    15. #重启apache
    16. Service httpd Restart

Redis and Phpredis extended installation under Linux

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.