zoukankan      html  css  js  c++  java
  • Ubutun 配置php redis 扩展

    1、安装redis

    下载:wget --no-check-certificate https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

    tar zxvf phpredis-2.2.4.tar.gz #解压

    cd phpredis-2.2.4 #进入安装目录

    /opt/software/php/bin/phpize #用phpize生成configure配置文件

    ./configure --with-php-config=/opt/software/php/bin/php-config  #配置

    make  #编译

    make install  #安装

    安装完成之后,出现下面的安装路径

    opt/software/php/lib/php/extensions/no-debug-non-zts-20131226# cd /opt/home/redis/

    2、配置php支持

    vi /etc/php.ini  #编辑配置文件,在最后一行添加以下内容

    添加

    extension=redis.so

    :wq! #保存退出

    3  重启服务

    sudo service nginx restart

    sudo  service php-fpm restart

    windows:下载redis.dll 扩展,先phpinfo 查看VC版本 和PHP版本,下载相对应的redis 版本

    php.ini 添加编辑进去即可

    安装redis

    1、下载安装
    # apt-cache search redis
    # apt-get install redis-server

    a、redis配置文件:/etc/redis/redis.conf
    b、redis服务路径:/etc/init.d/redis-server

    2、启动redis
    # cd /etc/init.d
    # redis-server &
    注:要先进入"/etc/init.d"目录,再执行"redis-server &"命令启动redis

    3、启动client客户端连接
    # redis-cli
    127.0.0.1:6379> set name aaa
    OK
    127.0.0.1:6379> get name
    "aaa"
    127.0.0.1:6379>

  • 相关阅读:
    GIT更改clone方式 ;GIT的SSH配置
    关于web性能测试的一些总结
    pyinstaller 打包selenium程序后,消除chromdriver 控制台黑框
    pyinstaller 打包exe 遇到的坑
    jenkins 新增节点的3种方式
    class
    python 语法糖
    模块 subprocess
    模块 re
    模块 logging
  • 原文地址:https://www.cnblogs.com/already/p/5556743.html
Copyright © 2011-2022 走看看