Imagick failed to load in Ubuntu 20.04

Hi, I have just upgraded to Ubuntu 20.04 Focal Fossa and also installed Imagick software from its php package.

The software is working fine as I could generate a gif file but its was not loaded when I used phpinfo() to view the php info. The wordpress software also complains that imagick software is either disabled or not installed.

Thinking it is an extension problem, I tried to insert the line "extension=imagick.so" in php.ini but to no avail.

Appreciate any help.

Thanks!
David

3 Replies

@hontosan --

It sounds like an extension problem to me…

You may have modified the wrong php.ini file. On Debian/Ubuntu, there's more than one (7.3 is my release; yours may be different):

  • one for the cli in /etc/php/7.3/cli;
  • one for php-fpm in /etc/php/7.3/fpm;
  • one for the embedded php processor if you use the php processor module in apache2 (I don't use it so I forget what it's called).

You'll also have to make sure the /etc/php/mods-available/imagick.ini is symlinked properly into /etc/php/7.3/cli/conf.d, /etc/php/7.3/fpm/conf.d, etc.

-- sw

PS If you use php-fpm the reason for the failure will be logged in /var/log/php-fpm.log. If you use the embedded module, the reason will be logged in your web server log.

stevewi. thanks for your reply.

When I upgraded to Ubuntu 20.04 Focal Fossa, it also upgraded the PHP to 7.4 and so I went to the 7.4 folder to edit the php.ini file.

I actually tried to install the extension file initially but I used "apt install php-imagick" cmd which was not correct. After much searching on the net, I finally found that I got to use "apt install php7.4-imagick" to install the right php extension file and the problem was resolved!

@hontosan --

Glad to hear it! In the future, you can do something like this:

apt-cache search imagick | grep php

to figure out the name of the package you need.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct