My wordpress Site health show imagick, is not installed, or has been disabled. So I installed imagick and php-imagick by command line.

sudo apt-get install imagemagick
sudo apt-get install php-imagick
sudo service apache2 restart

But now imagick still missing on worpress. What should I do next?

Thanks in advance.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hello, @eakrin

What happens when you execute the following commands on the server?

  • php -i | grep -i imagick
  • php -m | grep imagick

Can you share the output? Also what you can do is to create an info.php file. You can create a file named info.php (the name doesn’t really matter) and put the following content in the file:

  • <?php
  • phpinfo();

You can then check which is the configuration file - php.ini that is currently used and so we can edit it. You can also check this with the PHP -i command again:

  • php -i | grep -i php.ini

Then you can edit the listed php.ini and add the following line:

extension=imagick

Note that this line can already exist there but might be commented out, e.g listed like this:
;extension=imagick

If that is the case just remove the ; and save the php.ini file.

Once this is done you can restart the Apache server and check again.

  • sudo service apache2 restart

Hope that this helps!
Regards,
Alex

Result of command php -i | grep -i imagick and php -m | grep imagick is nothing.

In infol.php

System  Linux wordpress-18 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64
Build Date  Feb 23 2021 15:12:05
Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc/php/7.4/apache2
Loaded Configuration File   /etc/php/7.4/apache2/php.ini
Scan this dir for additional .ini files /etc/php/7.4/apache2/conf.d

My php.ini should be in /etc/php/7.4/apache2 But I try to add

extension=imagick

after restart apache nothing happen.

So I try php -i | grep -i php.ini The result is /etc/php/7.4/cli so I added extension to this php.ini file. This time result is

unable to load dynamic library 'imagick', /usr/lib/php/20190902/imagick No such file of directory, cannot open shared object file

I search for imagick.so in /usr/lib/php/20190902. It not found. But it’s in /usr/lib/php/20190930.

I think this cause a problem. The wrong library location in setting. But how can I modified location of imagick.so?

Thanks.