# Getting a mautic.Critical "Undefined constant "ELFINDER\_IMAGEMAGICK\_PS" error

**URL:** https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073
**Category:** Product Support
**Tags:** mautic-4
**Created:** [August 25, 2023, 6:29pm UTC](https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073 "2023-08-25T18:29:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![beholmes1983](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/beholmes1983/32/10395_2.png) [@beholmes1983](https://forum.mautic.org/u/beholmes1983)
#### Post date: [August 25, 2023, 6:29pm UTC](https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073/1 "2023-08-25T18:29:20Z")

</div>

**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.

---

<div class="post-metadata">

### Author: ![beholmes1983](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/beholmes1983/32/10395_2.png) [@beholmes1983](https://forum.mautic.org/u/beholmes1983)
#### Post date: [August 25, 2023, 6:33pm UTC](https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073/2 "2023-08-25T18:33:20Z")

</div>

Also, I have found this github [issue](https://github.com/mautic/mautic/issues/11897), but Im not really sure what the solution is from that.

---

<div class="post-metadata">

### Author: ![lsouza](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@lsouza](https://forum.mautic.org/u/lsouza)
#### Post date: [November 22, 2023, 8:17pm UTC](https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073/3 "2023-11-22T20:17:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![shishir](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@shishir](https://forum.mautic.org/u/shishir)
#### Post date: [April 1, 2024, 6:30am UTC](https://forum.mautic.org/t/getting-a-mautic-critical-undefined-constant-elfinder-imagemagick-ps-error/29073/4 "2024-04-01T06:30:44Z")

</div>

Thank you. Its working fine.
