phpredis extension doesn't work, unable to load 'redis.so'

后端 未结 5 1863
失恋的感觉
失恋的感觉 2021-02-13 11:45

I installed nginx, php, php-fpm, php-pecl-redis by yum.

All of them work but the last one.

When I run /usr/sbin/php-fpm, I got this:

相关标签:
5条回答
  • 2021-02-13 12:12

    I had the same issue. I'm on Ubuntu 16.04 LTS. Running sudo apt-get install php-igbinary resolved the issue for me. I have other issues, but that's what solved this one.

    0 讨论(0)
  • just resolve the same problem:

    php-pecl-redis installed by yum will cause this problem. so you need to install the php-redis manually. wget the package and phpize - configure - make ....

    0 讨论(0)
  • 2021-02-13 12:21

    Probably an issue with igbinary, is this installed? (try for example: cat /etc/php.d/igbinary.ini).

    Here you can find and install igbinary

    0 讨论(0)
  • 2021-02-13 12:25

    For people who are upgrading their php from 7.0 to 7.4 like me, and not able to get php-redis working. These are the steps I used after following the answers above.

    1) remove Redis

    sudo apt purge php-redis
    

    2) Install Igbinary

    sudo apt-get install php-igbinary
    

    3) Install php-redis again

    sudo apt-get install php-redis
    

    I did the steps above because it seems only php7.0 is recognising the php-redis install but not the currently enabled php7.4

    I also recommend removing other versions of PHP if you have should your problem continue unsolved.

    0 讨论(0)
  • 2021-02-13 12:36

    Related to this bug https://bugs.launchpad.net/ubuntu/+source/php-redis/+bug/1762935

    You should remove php-redis from packages: apt purge php-redis , and install it via pecl install redis

    You should add "extension=redis.so" to php.ini

    and remove redis from config.d in your php directory:

    rm /etc/php/7.2/fpm/conf.d/@20-redis.ini
    

    and

    rm /etc/php/7.2/cli/conf.d/@20-redis.ini
    

    restart php fpm and you will see that problem solved

    0 讨论(0)
提交回复
热议问题