So my host found a fix for this problem but it’s not a very good one as it changes line 465 in the ewww-image-optimizer.php file from this
$finfo = finfo_open(FILEINFO_MIME);
to this
$finfo = finfo_open(FILEINFO_MIME, '/usr/share/magic');
it solves the problem but it will get overridden with the next update.
and after reading the php docs for the finfo_open() function and it says this for the second parameter
“Name of a magic database file, usually something like /path/to/magic.mime. If not specified, the MAGIC environment variable is used. If the environment variable isn’t set, then PHP’s bundled magic database will be used. Passing NULL or an empty string will be equivalent to the default value.”
I checked $SERVER[‘MAGIC’] and it is NULL, is this why I’m getting the error?
This is all a bit beyond me.