zoukankan      html  css  js  c++  java
  • ubuntu安装redis

    安装最新版本的redis

    1: build redis模块redis.so:

    //For Debian-based Linux distros you need a php-dev and pkg-php-tools packages 
    //to build native PHP extension from phpredis source code sudo apt update sudo apt install php-dev pkg-php-tools --yes sudo pecl channel-update pecl.php.net sudo pecl install redis

    如果遇到第三步pecl有warning

    Warning: foreach() argument must be of type array|object, null given in Command.php on line 249
    PHP Warning:  foreach() argument must be of type array|object, null given in /usr/share/php/PEAR/Command.php on line 249
    
    Warning: Undefined array key "phpfile" in Role.php on line 204
    PHP Warning:  Undefined array key "phpfile" in /usr/share/php/PEAR/Installer/Role.php on line 204
    
    Warning: Undefined array key "config_vars" in Role.php on line 46
    PHP Warning:  Undefined array key "config_vars" in /usr/share/php/PEAR/Installer/Role.php on line 46
    
    Warning: Undefined array key "config_vars" in Role.php on line 46
    PHP Warning:  Undefined array key "config_vars" in /usr/share/php/PEAR/Installer/Role.php on line 46

    执行这行,更新php到最新版8.0.3

    sudo apt-get install php-xml php7.0-xml

    2: 配置启动redis.so extension

    //Build process completed successfully
    //Installing '/usr/lib/php/20200930/redis.so'
    //install ok: channel://pecl.php.net/redis-5.3.3
    //configuration option "php_ini" is not set to php.ini location
    //You should add "extension=redis.so" to php.ini
    
    sudo vim /etc/php/8.0/cli/php.ini

    //add one line of extension
    extension=redis.so

    How to Get Redis-cli Without Installing Redis Serve

    link

  • 相关阅读:
    OpenFlow 消息
    Revolving Digits
    Tavas and Malekas
    Prefixes and Suffixes
    快速构造后缀自动机
    REBXOR
    BZOJ3689 异或之
    BZOJ3689 异或之
    最长路径异或和
    BZOJ 1355 [Baltic2009] Bazinga
  • 原文地址:https://www.cnblogs.com/shawnzxx/p/14528979.html
Copyright © 2011-2022 走看看