question

BjrnHasselberg-7167 avatar image
1 Vote"
BjrnHasselberg-7167 asked EmmadishettyAravind-5998 commented

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

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-webapps
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for asking question! I have started discussion with PG team on this, will update you as soon as I receive.

1 Vote 1 ·

Just checking in to see if the below answers helped. If this answers your query, do click “Accept Answer” and Up-Vote for the same.
And, if you have any further query do let us know.

0 Votes 0 ·

1 Answer

SnehaAgrawal-MSFT avatar image
1 Vote"
SnehaAgrawal-MSFT answered EmmadishettyAravind-5998 commented

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.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Works like charm, many thanks

0 Votes 0 ·

Hi,
I am using wordpress. After adding PHP_INI_SCAN_DIR, I am getting an error that mysql_connect() is not defined.
Can you help me with this problem .
Thank you!

0 Votes 0 ·