Php-imagick Extension Warning

Hello

I am trying to enable the php-imagick extension, but I keep getting the following warning:

Warning: PHP Startup: Unable to load dynamic library ‘imagick.so’ (tried: /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so (/usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so: cannot open shared object file: No such file or directory), /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so.so (/usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I have a clean installation of Clear Linux and I have taken the following steps:

sudo swupd update
sudo mkdir -p /etc/php.d
for ext in apcu redis imagick; do echo “extension=${ext}.so” | sudo tee -a /etc/php.d/${ext}.ini; done

I have checked and imagick.so is not in the listed directory:

sudo ls -l /usr/lib64/extensions/no-debug-non-zts-20200930/
total 8900
-rwxr-xr-x 1 root root 39408 Feb 1 2019 ahocorasick.so
-rwxr-xr-x 1 root root 88304 Feb 1 2019 apcu.so
-rwxr-xr-x 1 root root 14496 Feb 1 2019 apfd.so
-rwxr-xr-x 1 root root 60840 Feb 1 2019 ast.so
-rwxr-xr-x 1 root root 26864 Feb 1 2019 bitset.so
-rwxr-xr-x 1 root root 63728 Feb 1 2019 componere.so
-rwxr-xr-x 1 root root 90752 Feb 1 2019 crypto.so
-rwxr-xr-x 1 root root 39152 Feb 1 2019 dbase.so
-rwxr-xr-x 1 root root 72656 May 7 12:13 dba.so
-rwxr-xr-x 1 root root 278680 Feb 1 2019 ddtrace.so
-rwxr-xr-x 1 root root 40048 Feb 1 2019 dio.so
-rwxr-xr-x 1 root root 227528 Feb 1 2019 ds.so
-rwxr-xr-x 1 root root 149736 Feb 1 2019 ev.so
-rwxr-xr-x 1 root root 35112 Feb 1 2019 geospatial.so
-rwxr-xr-x 1 root root 60744 Feb 1 2019 gnupg.so
-rwxr-xr-x 1 root root 428392 Feb 1 2019 igbinary.so
-rwxr-xr-x 1 root root 14664 Feb 1 2019 json_post.so
-rwxr-xr-x 1 root root 64744 Feb 1 2019 krb5.so
-rwxr-xr-x 1 root root 22984 Feb 1 2019 lzf.so
-rwxr-xr-x 1 root root 68712 Feb 1 2019 mailparse.so
-rwxr-xr-x 1 root root 1410088 Feb 1 2019 mongodb.so
-rwxr-xr-x 1 root root 72552 Feb 1 2019 msgpack.so
-rwxr-xr-x 1 root root 89832 Feb 1 2019 oauth.so
-rwxr-xr-x 1 root root 1711120 May 7 12:13 opcache.so
-rwxr-xr-x 1 root root 39216 Feb 1 2019 pcov.so
-rwxr-xr-x 1 root root 291440 Feb 1 2019 protobuf.so
-rwxr-xr-x 1 root root 57480 Feb 1 2019 psr.so
-rwxr-xr-x 1 root root 22800 Feb 1 2019 raphf.so
-rwxr-xr-x 1 root root 116976 Feb 1 2019 rdkafka.so
-rwxr-xr-x 1 root root 619496 Feb 1 2019 redis.so
-rwxr-xr-x 1 root root 88304 Feb 1 2019 seaslog.so
-rwxr-xr-x 1 root root 67824 May 7 12:13 sqlite3.so
-rwxr-xr-x 1 root root 93064 Feb 1 2019 svm.so
-rwxr-xr-x 1 root root 43248 Feb 1 2019 sync.so
-rwxr-xr-x 1 root root 751704 Feb 1 2019 timezonedb.so
-rwxr-xr-x 1 root root 801008 Feb 1 2019 trader.so
-rwxr-xr-x 1 root root 43248 Feb 1 2019 vld.so
-rwxr-xr-x 1 root root 22984 Feb 1 2019 xattr.so
-rwxr-xr-x 1 root root 403696 Feb 1 2019 xlswriter.so
-rwxr-xr-x 1 root root 269064 Feb 1 2019 yaf.so
-rwxr-xr-x 1 root root 51720 Feb 1 2019 yaml.so
-rwxr-xr-x 1 root root 84848 Feb 1 2019 yar.so

It is however in the 20190902 directory:

sudo ls -l /usr/lib64/extensions/no-debug-non-zts-20190902/
total 14632
-rwxr-xr-x 1 root root 100584 Feb 1 2019 eio.so
-rwxr-xr-x 1 root root 5885320 Feb 1 2019 gender.so
-rwxr-xr-x 1 root root 5844224 Feb 1 2019 grpc.so
-rwxr-xr-x 1 root root 378248 Feb 1 2019 hprose.so
-rwxr-xr-x 1 root root 18672 Feb 1 2019 hrtime.so
-rwxr-xr-x 1 root root 437128 Feb 1 2019 imagick.so
-rwxr-xr-x 1 root root 18672 Feb 1 2019 inotify.so
-rwxr-xr-x 1 root root 26864 Feb 1 2019 jsmin.so
-rwxr-xr-x 1 root root 35488 Feb 1 2019 lua.so
-rwxr-xr-x 1 root root 118936 Feb 1 2019 memcached.so
-rwxr-xr-x 1 root root 481904 Feb 1 2019 parle.so
-rwxr-xr-x 1 root root 14624 Feb 1 2019 proctitle.so
-rwxr-xr-x 1 root root 39152 Feb 1 2019 propro.so
-rwxr-xr-x 1 root root 52320 Feb 1 2019 radius.so
-rwxr-xr-x 1 root root 31144 Feb 1 2019 scrypt.so
-rwxr-xr-x 1 root root 825696 Feb 1 2019 SeasClick.so
-rwxr-xr-x 1 root root 52744 Feb 1 2019 stomp.so
-rwxr-xr-x 1 root root 43400 Feb 1 2019 taint.so
-rwxr-xr-x 1 root root 51944 Feb 1 2019 timecop.so
-rwxr-xr-x 1 root root 68136 Feb 1 2019 uopz.so
-rwxr-xr-x 1 root root 301272 Feb 1 2019 xdebug.so
-rwxr-xr-x 1 root root 14824 Feb 1 2019 xxtea.so
-rwxr-xr-x 1 root root 102480 Feb 1 2019 zmq.so

I have tried changing the imagick.ini file to point to this location:

extension=/usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so

However, I now get the following warning:

Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so’ (tried: /usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so (/usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so: undefined symbol: instanceof_function_ex), /usr/lib64/extensions/no-debug-non-zts-20200930//usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so.so (/usr/lib64/extensions/no-debug-non-zts-20200930//usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Any suggestion on what is going on (or more correctly what I am doing wrong) and how to correct this?
Thank you

what is going on:

PHP Startup is trying to load a dynamic library that is located at
/usr/lib64/extensions/no-debug-non-zts-20200930/value of extension in ini file.so

First time there was ‘imagick.so’ after extension=, so it was looking for
/usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so.so
and could not find it.

Second time there was ‘/usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so’ after extension=, so it was looking for
/usr/lib64/extensions/no-debug-non-zts-20200930//usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so.so
and could not find that file either.

Correction should be obvious.

Ok, I get why adding the full path to the .ini file was not a good idea. However, I still can’t get the warning to go away.

I have tried sim-linking and coping the imagick.so to the location PHP is looking for it:

sudo ln -s /usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so

sudo cp /usr/lib64/extensions/no-debug-non-zts-20190902/imagick.so /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so

But I still get the same warning:

Warning: PHP Startup: Unable to load dynamic library ‘imagick.so’ (tried: /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so (/usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so: undefined symbol: instanceof_function_ex), /usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so.so (/usr/lib64/extensions/no-debug-non-zts-20200930/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Any suggestions? I have a feeling it is something obvious I am missing.

Thank you

I would try extension=imagick instead of extension=imagick.so

I think this just became a mutt point. I just did an update and now the imagick.so file is gone.

Thank you for the help anyways