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

Björn Hasselberg 66 Reputation points

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:
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.
7,326 questions
{count} vote

Accepted answer
  1. SnehaAgrawal-MSFT 20,241 Reputation points

    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
    ./configure --with-php-config=/usr/local/bin/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no
    ls -l /tmp/pear/temp/redis/modules
    mkdir -p /home/site/ext
    cp /tmp/pear/temp/redis/modules/ /home/site/ext/
    mkdir -p /home/site/ini
    echo "extension=/home/site/ext/" >> /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