Upload - Upload the webcomand folder and all of its files to the "htdocs" or "public_html" folder for the web server.
Set Up - Open a web browser to the URL of your website followed by "/webcomand" (ie. http://www.example.com/webcomand) and follow the set up instructions.
The webCOMAND Image Processing API can take advantage of ImageMagick through the PHP Imagick extension. Many Linux installations will have ImageMagick pre-installed. If ImageMagick is not installed, or a version is installed that does not support the features and file formats required, you may want to compile and install the latest version and additional libraries.
Upgrading ImageMagick
Some important features have been added in ImageMagick 7, including support for WebP and AVIF file formats, so it may be useful to upgrade. To upgrade on a Red Hat Enterprise Linux based Operating System (RHEL, Rocky Linux, VZ Linux, CentOS, etc.) where ImageMagick is already installed:
Uninstall existing packages.
Make sure it is installed with:
rpm -qa | grep -i magick
Uninstall the current RPMs.
yum remove ImageMagick ImageMagick-devel ImageMagick-libs
(press 'y' to uninstall the many dependencies)
Uninstall imagick.so
pecl uninstall imagick
Install the Latest version of ImageMagick
The following steps will install the latest version of ImageMagick with support for PNG, WebP, JPEG and AVIF image file formats, which are popular on the web.
Install Git
yum install git
Install PNG library (libpng, libzlib)
yum install libpng-devel
If the RPM is not available or you need the latest version, build from source:
git clone https://github.com/glennrp/libpng
cd libpng
./autogen.sh
./configure
make
make install
cd ../
Install JPEG library (libjpeg)
Download latest "jpegsrc" from http://www.ijg.org/files/ (currently http://www.ijg.org/files/jpegsrc.v9e.tar.gz)
wget http://www.ijg.org/files/jpegsrc.v9e.tar.gz
tar xvfz jpegsrc.v9e.tar.gz
cd jpegsrc-v9e
./configure --enable-shared
make
make install
cd ../
Install WebP library (libwebp)
yum install libwebp-devel
If the RPM is not available or you need the latest version, build from source
IMPORTANT: Add /usr/local/lib/pkgconfig to the PKG_CONFIG_PATH, so libheif ./configure will find the locally compiled libde265.pc package configuration file.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./autogen.sh
./configure
make -j4
make install
TIP: Make sure libheif is working correctly with libde265 (should output 'yes'):
pkg-config libheif --variable builtin_h265_decoder
IMPORTANT: Add /usr/local/lib/pkgconfig to the PKG_CONFIG_PATH, so ImageMagick ./configure will find the locally compiled libheif.pc package configuration files.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure
TIP: Make sure DELEGATES lists heic, jpeg and webp
Ideally: bzlib freetype heic jng jpeg png tiff webp x zip zlib
make
make install
cd ../
Install Imagic.so
pecl install imagick
Restart Apache (or php-fpm if installed)
systemctl restart php-fpm
We do not seem to need to do this: /sbin/ldconfig /usr/local/lib
Next you need to build libheif and libde265. This is a little more involved than just using a package manager unfortunately, but it's not too difficult when you get the right configure options.
The important thing, and where it went wrong for me a few times, was to check that libheif is working correctly with libde265. To check this you can run:
PKG_CONFIG_PATH is a environment variable that specifies additional paths in which pkg-config will search for its .pc files.
This variable is used to augment pkg-config's default search path. On a typical Unix system, it will search in the directories /usr/lib/pkgconfig and /usr/share/pkgconfig. This will usually cover system installed modules. However, some local modules may be installed in a different prefix such as /usr/local. In that case, it's necessary to prepend the search path so that pkg-config can locate the .pc files.
The pkg-config program is used to retrieve information about installed libraries in the system. The primary use of pkg-config is to provide the necessary details for compiling and linking a program to a library. This metadata is stored in pkg-config files. These files have the suffix .pc and reside in specific locations known to the pkg-config tool.
To check the PKG_CONFIG_PATH value use this command: