nrk/phpiredis

Docker / Alpine installation (phpiredis.so: redisReplyReaderGetReply: symbol not found)

Closed this issue ยท 4 comments

Hello,

are there any plans to support Alpine Linux? I really want to use this to increase performance and don't want to use Ubuntu/Debian images. The problem:

When installing hiredis-dev and phpiredis doing the following within my Dockerfile:

FROM php:7.3-fpm-alpine

RUN apk --update add \
    alpine-sdk \
    openssl-dev \
    php7-pear \
    php7-dev \
    supervisor \
    hiredis-dev \
    && rm -rf /var/cache/apk/*

RUN pecl channel-update pecl.php.net \
    && pecl install redis \
    && docker-php-ext-enable redis \
    && git clone https://github.com/nrk/phpiredis.git \
    && ( \
        cd phpiredis \
        && git checkout v1.0.0 \
        && phpize \
        && ./configure --enable-phpiredis \
        && make \
        && make install \
    ) \
    && rm -r phpiredis \
    && docker-php-ext-enable phpiredis

... I receive the error, that phpiredis couldn't be loaded:

docker run -it mycompany/php:latest php -i | grep redis
PHP Warning:  PHP Startup: Unable to load dynamic library 'phpiredis.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so: redisReplyReaderGetReply: symbol not found), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20180731/phpiredis.so.so: No such file or directory)) in Unknown on line 0
/usr/local/etc/php/conf.d/docker-php-ext-phpiredis.ini,
/usr/local/etc/php/conf.d/docker-php-ext-redis.ini,

'Note': Installing the phpiredis extension requires php to install both the APC and APCU extensions in addition to Hiredis, otherwise the dynamic library cannot be loaded.

@yanzzchn your comment isn't helpful in this case. The error has nothing to do with apc / apcu. The issue is a duplicate of to #61 and #46

The problem here is that the solution presented in #46 is also not so helpful. The version of hiredis that ships with Alpine 3.10 (as an installable package) is 0.14.0r2 (as can be seen with an Alpine repo hiredis search).

@renepardon until this is resolved, I recommend compiling hiredis 0.13.3 from source in your Docker image.

Duplicate of #61

nrk commented

Changes to support Hiredis >= 0.14, >= 1.0 have been merged in the v1.1 branch, the new minor release will be shipped in a few days is everything is fine. Thank you.