Getting a mautic.Critical "Undefined constant "ELFINDER_IMAGEMAGICK_PS" error

Your software
My Mautic version is: 4.4.5
My PHP version is: 8.0.29
My Database type and version is: 10.6.12-MariaDB-0ubuntu0.22.04.1

Your problem
My problem is: Sending emails stay in pending if I have my email setting set to ‘Send immediately’, if I have it set to Queue, they just stay in the queue

These errors are showing in the log: mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: “Undefined constant “ELFINDER_IMAGEMAGICK_PS”” at /var/www/mautic/vendor/studio-42/elfinder/php/elFinderVolumeDriver.class.php line 5570 {“exception”:“[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Undefined constant "ELFINDER_IMAGEMAGICK_PS" at /var/www/mautic/vendor/studio-42/elfinder/php/elFinderVolumeDriver.class.php:5570)”

Steps I have tried to fix the problem: I tried to update to mautic 4.4.5, but then I started seeing this from the cron daemon: /bin/sh: 1: www-data: not found. When I rolled back to my backups, I now get the same /bin/sh: 1: www-data: not found error also.

Also, here are my cron jobs:

process email queue

*/3 9 * * * www-data php8.0 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null | logger -t mycmd
*/3 10 * * * www-data php8.0 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null | logger -t mycmd
*/3 11 * * * www-data php8.0 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null | logger -t mycmd
*/3 12 * * * www-data php8.0 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null | logger -t mycmd
*/3 13 * * * www-data php8.0 /var/www/html/mautic/bin/console mautic:emails:send > /dev/null | logger -t mycmd

I set mailto my email and the logger send the /bin/sh: 1: www-data: not found error to my email.

Also, I have found this github issue, but Im not really sure what the solution is from that.

Basically you need to install the lib image magick.
I’m using the debian 11 and this steps resolved the same problem.

sudo apt update
sudo apt install libpng-dev libjpeg-dev libtiff-dev
sudo apt install imagemagick

After this point I installed the php lib ( in my case php 8.0 )

sudo apt install php8.0-imagick

Thank you. Its working fine.