Share via

Still not possible to build redis.so under php 7.4 using "pecl install"

Björn Hasselberg 66 Reputation points
Jan 31, 2021, 9:09 AM

I see that 7.4 is now available on my app services. Unfortunatley installing redis using pecl that I need is not working on 7.4, so I am still stuck at 7.3.

More exactly, this does not work in 7.4: https://azureossd.github.io/2019/01/29/azure-app-service-linux-adding-php-extensions/
Extract from stdout:

running: make
/bin/bash /tmp/pear/temp/pear-build-root9dDnEO/redis-5.3.2/libtool --mode=compile cc -I. -I/tmp/pear/temp/redis -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root9dDnEO/redis-5.3.2/include -I/tmp/pe
ar/temp/pear-build-root9dDnEO/redis-5.3.2/main -I/tmp/pear/temp/redis -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/loca
l/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/php/ext -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/redis/redis.c -o redis.lo
cc -I. -I/tmp/pear/temp/redis -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root9dDnEO/redis-5.3.2/include -I/tmp/pear/temp/pear-build-root9dDnEO/redis-5.3.2/main -I/tmp/pear/temp/redis -I/usr/local
/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/php/e
xt -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/redis/redis.c -fPIC -DPIC -o .libs/redis.o
/tmp/pear/temp/redis/redis.c:22:10: fatal error: config.h: No such file or directory

include "config.h"

^~~~~~~~~~
compilation terminated.
make: *** [Makefile:192: redis.lo] Error 1

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,512 questions
{count} vote

Accepted answer
  1. SnehaAgrawal-MSFT 22,346 Reputation points
    Feb 3, 2021, 7:18 AM

    Apologize for the late response. Yes you are correct, pecl build of redis is broken on PHP 7.4. As this issue is with PHP itself, so reaching out to PHP community would be helpful here.

    If you want redis and PHP 7.4 then refer to below work-around.

    <open SSH window>

    mkdir -p /tmp/pear/temp
    cd /tmp/pear/temp
    pecl bundle redis
    cd redis
    phpize
    ./configure --with-php-config=/usr/local/bin/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no
    make
    ls -l /tmp/pear/temp/redis/modules
    mkdir -p /home/site/ext
    cp /tmp/pear/temp/redis/modules/redis.so /home/site/ext/redis.so
    mkdir -p /home/site/ini
    echo "extension=/home/site/ext/redis.so" >> /home/site/ini/extensions.ini

    then add PHP_INI_SCAN_DIR app setting with a value of "/usr/local/etc/php/conf.d:/home/site/ini"

    Hope this helps.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.