title: ImageMagick With HEIC Support PHP 7.4
body: <p>I compiled the latest ImageMagick with HEIC support and it is running from the command line in Terminal but not in PHP. Apparently, according to the Apache2 log, PHP cannot locate and load the extension. It seems in PHP 7.4 that extensions are no longer enabled in php.ini but rather each has its own .ini and the one for imagick is at</p>
  
  <pre><code>/etc/php/7.4/mods-available/imagick.ini
  </code></pre>
  
  <p>. . . or possibly  in (not sure which is being used but both have it enabled):</p>
  
  <pre><code>/etc/php/7.4/cli/conf.d/20-imagick.ini
  </code></pre>
  
  <p>but I am not sure where the imagick.so file is actually located and using <em>locate imagick.so</em> does not find it. ImageMagick was compiled and installed using this but, other than a slight modification, I did not write it:</p>
  
  <pre><code>sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
  sudo apt-get update
  sudo apt-get install build-essential autoconf git-core
  sudo apt-get build-dep imagemagick libde265 libheif
  cd /usr/src/ 
  sudo git clone https://github.com/strukturag/libde265.git  
  sudo git clone https://github.com/strukturag/libheif.git 
  cd libde265/ 
  sudo ./autogen.sh 
  sudo ./configure 
  sudo make –j4  
  sudo make install 
  cd /usr/src/libheif/ 
  sudo ./autogen.sh 
  sudo ./configure 
  sudo make –j4  
  sudo make install 
  cd /usr/src/ 
  sudo wget https://www.imagemagick.org/download/ImageMagick.tar.gz 
  sudo tar xf ImageMagick.tar.gz 
  cd ImageMagick-7*
  sudo ./configure --with-heic=yes 
  sudo make –j4  
  sudo make install  
  sudo ldconfig  
  mogrify --version
  </code></pre>
  
  <p>which outputs this when done:</p>
  
  <pre><code>Version: ImageMagick 7.0.9-8 Q16 x86_64 2019-12-21 https://imagemagick.org
  Copyright: © 1999-2020 ImageMagick Studio LLC
  License: https://imagemagick.org/script/license.php
  Features: Cipher DPC HDRI OpenMP(4.5) 
  Delegates (built-in): bzlib djvu fontconfig freetype heic jbig jng jpeg lcms lqr lzma openexr png tiff wmf x xml zlib
  </code></pre>