ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi

I'm getting this error on multiple cPanel servers. This is for all PHP versions near as I can tell:

Code:
 [Tue Jun 23 11:35:26 2020] [error] [pid 21033] mod_cgi.c(175): [client IP Masked:12815] AH01215: PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/imagick.so' - libMagickWand.so.5: cannot open shared object file: No such file or directory in Unknown on line 0: /usr/local/cpanel/cgi-sys/ea-php71
I'm having a bit of trouble deciphering what it means. The imagick.so is there in the path:

Code:
[[email protected] apache2]# ls /opt/cpanel/ea-php71/root/usr/lib64/php/modules/imagick.so
/opt/cpanel/ea-php71/root/usr/lib64/php/modules/imagick.so
[[email protected] apache2]#
Any help in getting this resolved and understanding what is going on (I'm continuing to do my own research as well, just thought I would post in addition) would be helpful.

Thanks
 

Edson Silva

Registered
Jun 24, 2020
3
0
1
Brazil
cPanel Access Level
Reseller Owner
Hi, I fixed this error by following these steps:

1 - In the WHM panel look for software
2 - Click on Module Installers
3 - Click on Manager in PHP PECL
4 - Search for imagick and click install
5 - Done.

See if it will fix it for you too.
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
thanks for all of the suggestions, I will try these and get back to you. I have a question, if we update our CentOS cPanel server via yum (manually - and not through the yellow cPanel update buttons). Can this cause this kind of breakage or any kind of breakage? Should we only update cPanel through the yellow update buttons?
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi @Edson Silva

Thanks for the post, I tried it, I get the same results of trying to install it on the command line. But here is the tlrd; followed by the full output.

tldr;
Code:
checking for MagickWand.h or magick-wand.h header... configure: error: Unable to find MagickWand.h or magick-wand.h header
ERROR: `/root/tmp/pear/imagick/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config --with-imagick' failed
Full Output:
Code:
Loaded plugins: fastestmirror, tsflags, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 208.100.0.204
 * cpanel-addons-production-feed: 208.100.0.204
 * cpanel-plugins: 208.100.0.204
 * base: mirror.us.oneandone.net
 * epel: mirror.steadfastnet.com
 * extras: mirror.trouble-free.net
 * updates: mirror.grid.uchicago.edu
 * webtatic: us-east.repo.webtatic.com
Package ImageMagick-devel-6.9.10.68-3.el7.x86_64 already installed and latest version
Nothing to do
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading imagick-3.4.4.tgz ...
Starting to download imagick-3.4.4.tgz (253,434 bytes)
.....................................................done: 253,434 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
Please provide the prefix of ImageMagick installation [autodetect] : building in /root/tmp/pear/pear-build-rootGPH7BK/imagick-3.4.4
running: /root/tmp/pear/imagick/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php74/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php74/root/usr/include/php -I/opt/cpanel/ea-php74/root/usr/include/php/main -I/opt/cpanel/ea-php74/root/usr/include/php/TSRM -I/opt/cpanel/ea-php74/root/usr/include/php/Zend -I/opt/cpanel/ea-php74/root/usr/include/php/ext -I/opt/cpanel/ea-php74/root/usr/include/php/ext/date/lib
checking for PHP extension directory... /opt/cpanel/ea-php74/root/usr/lib64/php/modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php74/root/usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... It exists
found in /usr/local/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 7.0.5 Q16 HDRI
checking for MagickWand.h or magick-wand.h header... configure: error: Unable to find MagickWand.h or magick-wand.h header
ERROR: `/root/tmp/pear/imagick/configure --with-php-config=/opt/cpanel/ea-php74/root/usr/bin/php-config --with-imagick' failed
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
when doing a locate on that missing file, here it is

Code:
[[email protected] ~]# locate MagickWand.h
/home/virtfs/username/usr/include/ImageMagick-6/wand/MagickWand.h
/home/virtfs/username/usr/local/bin/MagickWand.h
/home/virtfs/username/usr/local/cpanel/3rdparty/include/MagickWand.h
/home/virtfs/username/usr/src/ImageMagick-7.0.5-7/www/api/MagickWand/struct__MagickWand.html
/usr/include/ImageMagick-6/wand/MagickWand.h
/usr/local/bin/MagickWand.h
/usr/local/cpanel/3rdparty/include/MagickWand.h
/usr/src/ImageMagick-7.0.5-7/www/api/MagickWand/struct__MagickWand.html
Code:
[[email protected] ~]# locate magick-wand.h
/home/virtfs/username/usr/include/ImageMagick-6/wand/magick-wand.h
/home/virtfs/username/usr/src/ImageMagick-7.0.5-7/www/magick-wand.html
/home/virtfs/username/usr/src/ImageMagick-7.0.5-7/www/api/magick-wand.html
/usr/include/ImageMagick-6/wand/magick-wand.h
/usr/src/ImageMagick-7.0.5-7/www/magick-wand.html
/usr/src/ImageMagick-7.0.5-7/www/api/magick-wand.html
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Upon closer inspection. It appears the soft link is pointing to is missing (as well?) // Note: the destination is white lettering with a red blinking block around the white text

from /usr/local/bin

Code:
[[email protected] bin]# ls -l MagickWand.h
lrwxrwxrwx 1 root root 52 Jun 22  2017 MagickWand.h -> /usr/src/ImageMagick-7.0.5-7/MagickWand/MagickWand.h
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
it looks like ImageMagick it is looking for is version 7 and I have 6 installed? Plus not in the path . Yum shows version 6 installed

Code:
[email protected] ~]# rpm -qa | grep -i magick
ImageMagick-devel-6.9.10.68-3.el7.x86_64
ImageMagick-perl-6.9.10.68-3.el7.x86_64
ImageMagick-6.9.10.68-3.el7.x86_64
ImageMagick-c++-6.9.10.68-3.el7.x86_64
and also looks like I have version 7 installed?

Code:
(from /usr/local/bin)

[[email protected] bin]# ls -l
total 80
lrwxrwxrwx. 1 root root    39 Jan 20  2017 crontab -> /usr/local/cpanel/bin/jail_safe_crontab
-rwxr-xr-x  1 root root 40811 Apr 28 17:25 ea_convert_php_ini
-rwxr-xr-x  1 root root  3074 Apr 28 17:25 ea_current_to_profile
-rwxr-xr-x  1 root root  3636 Apr 28 17:25 ea_install_profile
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php54 -> /opt/cpanel/ea-php54/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php55 -> /opt/cpanel/ea-php55/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php56 -> /opt/cpanel/ea-php56/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php70 -> /opt/cpanel/ea-php70/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php71 -> /opt/cpanel/ea-php71/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:12 ea-php72 -> /opt/cpanel/ea-php72/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php73 -> /opt/cpanel/ea-php73/root/usr/bin/php
lrwxrwxrwx  1 root root    37 Jun 22 22:13 ea-php74 -> /opt/cpanel/ea-php74/root/usr/bin/php
-rwxr-xr-x  1 root root  6888 Apr 28 17:25 ea_sync_user_phpini_settings
-r-xr-xr-x  1 root root  4194 Jun 11  2019 instmodsh
-r-xr-xr-x  1 root root  7098 Jun 11  2019 json_xs
-rwxr-xr-x  1 root root   937 Apr 27 10:13 lsphp
lrwxrwxrwx  1 root root    57 Jun 22  2017 MagickWand-config -> /usr/src/ImageMagick-7.0.5-7/MagickWand/MagickWand-config
lrwxrwxrwx  1 root root    52 Jun 22  2017 MagickWand.h -> /usr/src/ImageMagick-7.0.5-7/MagickWand/MagickWand.h
lrwxrwxrwx. 1 root root    38 Jan 20  2017 passwd -> /usr/local/cpanel/bin/jail_safe_passwd
lrwxrwxrwx  1 root root    38 Apr 23  2019 pear -> /opt/cpanel/ea-php55/root/usr/bin/pear
-rwxr-xr-x  1 root root   933 Apr 27 10:13 php

=========================================================================================================================================
Trying to locate the missing MagickWand.h file (that is a red blinking block with white text -- see previous posts)

MagickWand.h -> /usr/src/ImageMagick-7.0.5-7/MagickWand/MagickWand.h


[[email protected] bin]# cd /usr/src/ImageMagick-7.0.5-7/MagickWand/

[[email protected] MagickWand]# pwd
/usr/src/ImageMagick-7.0.5-7/MagickWand

[[email protected] MagickWand]# ls -l MagickWand.h
ls: cannot access MagickWand.h: No such file or directory
do I have conflicting version installed?
 
Last edited:

andrew.n

Well-Known Member
Jun 9, 2020
461
119
43
EU
cPanel Access Level
Root Administrator
so how did you install ImageMagick in the first place? As far as I know imagick is only from PHP 7.2 and up.
 

andrew.n

Well-Known Member
Jun 9, 2020
461
119
43
EU
cPanel Access Level
Root Administrator
okay so you used yum. Can you try to remove what you installed via yum? then install it again as @Edson Silva mentioned.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,259
313
Houston
Actually it looks like you're right - that symlink shouldn't be there by default either - you're smlinked to a different version of MagickWand entirely:

Code:
[[email protected] bin]# stat /bin/MagickWand-config
  File: ‘/bin/MagickWand-config’
  Size: 1277          Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 932957      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-01 10:52:42.482175298 -0500
Modify: 2020-03-31 21:51:19.000000000 -0500
Change: 2020-04-28 05:20:00.191621776 -0500
 Birth: -
Code:
[[email protected] bin]# locate MagickWand
/usr/bin/MagickWand-config
/usr/include/ImageMagick-6/wand/MagickWand.h
/usr/lib64/libGraphicsMagickWand-Q16.so.2
/usr/lib64/libGraphicsMagickWand-Q16.so.2.9.3
/usr/lib64/libMagickWand-6.Q16.so
/usr/lib64/libMagickWand-6.Q16.so.6
/usr/lib64/libMagickWand-6.Q16.so.6.0.0
/usr/lib64/pkgconfig/MagickWand-6.Q16.pc
/usr/lib64/pkgconfig/MagickWand.pc
/usr/share/man/man1/MagickWand-config.1.gz
Now altphp does have a different version I believe:

Code:
/opt/alt/alt-ImageMagick/usr/lib64/libMagickWand-7.Q16HDRI.so.7
/opt/alt/alt-ImageMagick/usr/lib64/libMagickWand-7.Q16HDRI.so.7.0.0
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
It looks like I might have some cleanup to do on the server to remove imageMagick 7 and get things working again. On another server where that error was happening, I ran through the installation method suggested by @Edson Silva, it fixed the error with libmagicwand but now getting this error (again)

error:

Code:
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0

I ran across this cPanel forum. Is this still an issue?


as far as I can tell, it is only loaded once (except if virtfs is causing an issue)

Code:
bash-4.2# locate imagick.ini | xargs -I % grep -Hi "imagick.so" %
/home/virtfs/site1/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site1/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site2/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site3/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/home/virtfs/site4/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so
and nothing for this
Code:
bash-4.2# locate php.ini | xargs -I % grep -Hi "imagick.so" %
 
Last edited:

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Ok,

I commented out the extension loading in the following.

/opt/cpanel/ea-php54/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php55/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php56/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php70/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php71/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php72/root/etc/php.d/imagick.ini:extension=imagick.so
/opt/cpanel/ea-php73/root/etc/php.d/imagick.ini:extension=imagick.so

then I tested to see if the module was still loaded, and it seems to be. It must be getting loaded from somewhere else as well?
 

Edson Silva

Registered
Jun 24, 2020
3
0
1
Brazil
cPanel Access Level
Reseller Owner
Apparently your problem is a little more complicated than mine. But, still talking about what happened to me, it doesn't make any sense, but when I installed it I specified PHP7.3. The strange thing is that in other versions, the error continues and I had to install it in each one, even though it is the same truth as imagik. :s
 

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
I think I got this figured out finally. (I apologize for the running posts)

for the imagemagick 7/6 conflict I ran make uninstall/make clean/make distclean in the version 7 source directory. After that I was able to get the pecl modules installed per the instructions that @Edson Silva said. It seemed to work without having to re-install 6 from yum repos. It found everything fine. I still had to comment out imagick.so in the imagick.ini files as well as one php.ini .. then the already loaded errors went away.

I need to find where it is getting loaded from then :)
 

philsward

Active Member
Jan 3, 2017
26
9
3
USA
cPanel Access Level
Website Owner
I've run into a similar situation myself:

Code:
[05-Nov-2020 04:46:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so (libMagickWand-6.Q16.so.2: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php72/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
As opposed to
Code:
locate imagick.ini | xargs -I % grep -Hi "imagick.so" %
I ran
Code:
locate *.ini | xargs -I % grep -Hi "imagick.so" %
This gave me:
/opt/cpanel/ea-php72/root/etc/php.d/20-imagick.ini:extension=imagick.so
/opt/cpanel/ea-php72/root/etc/php.d/zzzzzzz-pecl.ini:extension="imagick.so"
/opt/cpanel/ea-php73/root/etc/php.d/20-imagick.ini:extension=imagick.so
/opt/cpanel/ea-php73/root/etc/php.d/zzzzzzz-pecl.ini:extension="imagick.so"

Since I'm also using redis, I am getting the "already loaded" warning with it as well.

/opt/cpanel/ea-php72/root/etc/php.d/10-redis.ini:extension=redis.so
/opt/cpanel/ea-php72/root/etc/php.d/zzzzzzz-pecl.ini:extension="redis.so"
/opt/cpanel/ea-php73/root/etc/php.d/10-redis.ini:extension=redis.so
/opt/cpanel/ea-php73/root/etc/php.d/zzzzzzz-pecl.ini:extension="redis.so"

Both are in PECL for 72 and 73

So, yes. They are both loading twice, one from the php.d 10 & 20 .ini and the other from the pecl.ini

The PECL one makes sense because they're physically loaded in PECL, but I haven't figured out why they are already loaded as part of the PHP install for 72 and 73.

I have PHP74 installed, but no PECLs.

Update: Just installed imagick PECL for PHP74 and it stuck it inside zzzzzzz-pecl.ini but did NOT create 20-imagick.ini

I am going to rename the 72 and 73 10-redis.ini and 20-imagemagick.ini for now so they aren't loading any more and see if I run into problems. I think it's fine to let PECL deal with these moving foward.

For me, this was a CentOS6 - CentOS7 migration through Oct 2020, so maybe something got left over during the mig.

Update 2: I'm still getting errors for magickwand.so on php73 but the "redis is already loaded" error has gone away finally.

It might have something to do with LiquidWeb's version of ImageMagick that was installed by default during the migration. They have their own older (6.9) version which was causing other problems. I ended up removing it and installing the more up-to-date version (6.10) and it got rid of of the lw-imagemagick erros.

Digging into the error a bit more, it appears that magickwand.so is a thing, but kind of a defunct thing. I couldn't (quickly) find any recent updates to it, so I ended up just renaming 20-magickwand.ini in /opt/cpanel/ea-php73/root/etc/php.d]

Be sure to restart apache (or fpm) after you rename or delete these ini files.
 
Last edited:
  • Like
Reactions: cPRex