PhpRedis was not compiled with Zstandard compression support

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
425
Hi all,

I'm trying to migrate a wordpress to my server, and I see and error in the log files:

Got error 'PHP message: objectcache.critical: Failed to initialize object cache: PhpRedis was not compiled with Zstandard compression support, see For more information about enabling compressions see: https://objectcache.pro/docs/data-encoding/', referer: https://www.mda-kapam.org/

When I run:

# php -i | grep -i zstd
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip, compress.zstd
ZSTD => No
ZSTD compression => No
zstd
Zstd support => enabled
zstd.output_compression => Off => Off
zstd.output_compression_dict => no value => no value
zstd.output_compression_level => -1 => -1


How do I enable the compression support?

thanks for any pointers.

-Sup.
 
/root # da build set_php "zstd" yes
php_zstd is already set to yes

/root # da build "php_zstd"
compiling zstd-0.14.0 for PHP 8.4...
download_cached: using cached '/usr/local/directadmin/custombuild/cache/zstd-pecl-0.14.0.tgz' file
Configuring for:
PHP Version: 8.4
PHP Api Version: 20240924
Zend Module Api No: 20240924
Zend Extension Api No: 420240924
...
(the building block)......

Installing shared extensions: /usr/local/php84/lib/php/extensions/no-debug-non-zts-20240924/
Installing header files: /usr/local/php84/include/php/
PHP 8.4 extension 'zstd' installed successfully
Restarting php-fpm84

/root # php -i | grep -i zstd
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip, compress.zstd
ZSTD => No
ZSTD compression => No
zstd
Zstd support => enabled
zstd.output_compression => Off => Off
zstd.output_compression_dict => no value => no value
zstd.output_compression_level => -1 => -1
 
try install "libzstd-devel" from "dnf" or "apt" and re-build "php_zstd" and "php_redis" again.
 
Last edited:
Hello,

You might use the custom script for building Redis with ZSTD support:

Bash:
cd /root/
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh

then run

Bash:
./php-extension.sh install redis

for testing run:

Bash:
php -i | grep -i "^Redis Support" -A 5

you would see something like:

Bash:
#Redis Support => enabled
Redis Version => 6.2.0
Redis Sentinel Version => 1.0
Available serializers => php, json
Available compression => lzf, zstd

where the line Available compression => lzf, zstd should prove you have zstd support enabled.

p.s. If you don't want to use the script you will need to build PHP Redis with PECL manually. The link that can be found in your starting post contains instructions.

How do I enable the compression support?
 
try install "libzstd-devel" from "dnf" or "apt" and re-build "php_zstd" and "php_redis" again.

I tried it already.. I re-built everything again and again (from custombuild) before/after attempting to install libzstd-devel.

/root # php -i | grep -i zstd
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip, compress.zstd
ZSTD => No
ZSTD compression => No
zstd
Zstd support => enabled
zstd.output_compression => Off => Off
zstd.output_compression_dict => no value => no value
zstd.output_compression_level => -1 => -1

/root # yum install libzstd-devel
Last metadata expiration check: 2:06:04 ago on Wed 07 May 2025 09:02:06 AM IDT.
Package libzstd-devel-1.5.1-2.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
 
Hello,

You might use the custom script for building Redis with ZSTD support:

Bash:
cd /root/
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh

then run

Bash:
./php-extension.sh install redis

for testing run:

Bash:
php -i | grep -i "^Redis Support" -A 5

you would see something like:

Bash:
#Redis Support => enabled
Redis Version => 6.2.0
Redis Sentinel Version => 1.0
Available serializers => php, json
Available compression => lzf, zstd

where the line Available compression => lzf, zstd should prove you have zstd support enabled.

p.s. If you don't want to use the script you will need to build PHP Redis with PECL manually. The link that can be found in your starting post contains instructions.
/root # ./php-extension.sh install redis
[OK] Started with PHP 8.4
[OK] Using default version for extension=redis for PHP 8.4
[OK] Updating /usr/local/php84/bin/pecl
[OK] Downloading redis for PHP 8.4
downloading redis-6.2.0.tgz ...
Starting to download redis-6.2.0.tgz (379,865 bytes)
.............................................................................done: 379,865 bytes
File /usr/local/src/redis-6.2.0.tgz downloaded
[OK] Going to install extension redis for PHP 8.4
[OK] Configuring redis for PHP 8.4
[OK] Compiling redis for PHP 8.4
[OK] Installation of redis for PHP 8.4 completed!
[OK] Disabling redis for PHP in DirectAdmin CustomBuild
Changed php_redis option from yes to no
[OK] Disabling redis in PHP 84 installed by DirectAdmin CustomBuild
[OK] Found redis.so. Enabling the extension in /usr/local/php84/lib/php.conf.d/90-custom.ini
redis
Redis Support => enabled
Redis Version => 6.2.0
[INFO] Going to restart PHP-FPM 8.4!
[INFO] Restarting php-fpm84!
[OK] Finished with PHP 8.4


root # php -i | grep -i "^Redis Support" -A 5
Redis Support => enabled
Redis Version => 6.2.0
Redis Sentinel Version => 1.0
Available serializers => php, json
Available compression => lzf, zstd



and:

/root # php -i | grep -i zstd
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip, compress.zstd
ZSTD => No
Available compression => lzf, zstd
ZSTD compression => No
zstd
Zstd support => enabled
zstd.output_compression => Off => Off
zstd.output_compression_dict => no value => no value
zstd.output_compression_level => -1 => -1



This solved the issue !!!
Thanks!
 
While I'm having this issue resolved,. the next one comes up:


Got error 'PHP message: objectcache.critical: Failed to initialize object cache: PhpRedis was not compiled with igbinary support. 'For more information about enabling serializers see: https://objectcache.pro/docs/data-encoding/'


I followed the same steps as with zstandard:


also did the steps from: https://forum.directadmin.com/threads/redis-install.64210/



/root # php -i | grep -i igbinary
igbinary
igbinary support => enabled
igbinary version => 3.2.16
igbinary APCu serializer ABI => no
igbinary session support => yes
igbinary.compact_strings => On => On
Registered serializer handlers => php_serialize php php_binary igbinary

but. I still get the PhpRedis was not compiled with igbinary support
And I'm not sure what I need to do now.

Probably something like: ./configure --enable-redis-igbinary needs to be pushed somewhere and then build? Or am I wrong?
I tried to rebuild php also from CustomBuild (also marked php_igbinary as Yes).

I'm still with this error.

any pointers on that?
 
any pointers on that?


Run

Bash:
cd /root
./php-extension.sh selfupdate
./php-extension.sh install igbinary
./php-extension.sh install redis

That should do a trick:

Bash:
# php -i | grep igbinary
igbinary
igbinary support => enabled
igbinary version => 3.2.16
igbinary APCu serializer ABI => no
igbinary session support => yes
igbinary.compact_strings => On => On
Available serializers => php, json, igbinary
Registered serializer handlers => php_serialize php php_binary igbinary
 
Last edited:
Run

Bash:
cd /root
./php-extension.sh selfupdate
./php-extension.sh install igbinary
./php-extension.sh install redis

That should do a trick:

Bash:
# php -i | grep igbinary
igbinary
igbinary support => enabled
igbinary version => 3.2.16
igbinary APCu serializer ABI => no
igbinary session support => yes
igbinary.compact_strings => On => On
Available serializers => php, json, igbinary
Registered serializer handlers => php_serialize php php_binary igbinary
wooopppiiiii
Yes.. that saved the situation completly.. thank you so much !!
 
Back
Top