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

  • 相关阅读:
    如何理解显示卡的驱动模块(DDX,DRM,DRI,XVMC)
    基于Linux的嵌入式文件系统构建与设计
    Windows系统——后缀为.zip.00X的zip分卷解压
    windows系统——U 盘损坏修复
    windows系统——常用命令
    U盘用FAT32还是用NTFS格式好
    linux系统程序设计教程
    Posix线程编程指南
    编程风格——UNIX 高手的 10 个习惯
    linux压缩文件——解压方法
  • 原文地址:https://www.cnblogs.com/shawnzxx/p/14528979.html
Copyright © 2011-2022 走看看