Skip to content
Advertisement

Centos 7 with PHP 7.2 Pthreads unable to load redis.so

I recently setup a new Centos 7 system with php 7.2 and Redis. This is working fine. This was my yum install of the php packages.

yum install php72.x86_64 php72-php-cli.x86_64 php72-php-common.x86_64 php72-php-devel.x86_64 php72-php-fpm.x86_64 php72-php-gd.x86_64 php72-php-json.x86_64 php72-php-mbstring.x86_64 php72-php-mysqlnd.x86_64 php72-php-pdo.x86_64 php72-php-pecl-http.x86_64 php72-php-pecl-http-devel.x86_64 php72-php-pecl-igbinary.x86_64 php72-php-pecl-memcached.x86_64 php72-php-pecl-msgpack.x86_64 php72-php-pecl-propro.x86_64 php72-php-pecl-raphf.x86_64 php72-php-xml.x86_64 php72-php-xmlrpc.x86_64 php72-runtime.x86_64 php72-php-pecl-redis.x86_64 php php-devel

Then I installed pthreads as explained in these directions at: https://gist.github.com/petronetto/b31838efc4a854d06ba5d1d9f3b9fec5 but I skipped the yum package install of the php 72 in the instructions.

Now when I check zts-php -i | grep -i thread I get the error, but zts-php otherwise works fine.

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/redis.so’ (tried: /usr/lib64/php/modules/redis.so (/usr/lib64/php/modules/redis.so: undefined symbol: compiler_globals), /usr/lib64/php-zts/modules//usr/lib64/php/modules/redis.so.so (/usr/lib64/php-zts/modules//usr/lib64/php/modules/redis.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I read I needed to install php-igbinary which I did, but it didn’t solve the issue.

How do I solve the undefined symbol: compiler_globals issue?

This is similar to this questions asked: phprediss extension don’t work,unable to load ‘redis.so’

Advertisement

Answer

Update redis from 4.2 to 4.3 with pecl

# pecl install redis
Advertisement