Score:0

How to correctly enable Imagick in PHP-FPM on Ubuntu 20.04 and Apache

in flag

I have PHP-FPM setup on my Ubuntu 20.04 server and have installed Imagick, but I cannot get it to be recognized by PHP 7.4. I tried following these steps, but step one returns the following error in Terminal.

-bash: /etc/php/7.4/mods-available/imagick.ini: Permission denied
  1. sudo echo extension=imagick.so > /etc/php/7.4/mods-available/imagick.ini
  2. sudo ln -s /etc/php/7.4/mods-available/imagick.ini /etc/php/7.4/fpm/conf.d/20-imagick.ini
  3. sudo ln -s /etc/php/7.4/mods-available/imagick.ini /etc/php/7.4/cli/conf.d/20-imagick.ini

The soft links worked correctly as I can see the files in each respective directory.

Is this just a permission issue or is there something else I need to complete to get this working? The permissions on the imagick.ini file are below.

-rw-r--r-- 1 root root 60 Mar  2  2020 /etc/php/7.4/mods-available/imagick.ini

PHP info shows /etc/php/7.4/fpm/conf.d/20-imagick.ini as being parsed, but not loaded like the GD library.

PHP 8.0.8 is the version that is returned when using php -v

Michael Hampton avatar
cz flag
First you need to decide if you're going to be using PHP 7.4 or 8.0. Trying to have both installed at once, as you have done, will only lead to confusion and breakage. Delete one or the other.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.