By tedious moments about this problem, I've found a solution that might be able to repair a system if you tried to uninstall and install ImageMagick with PECL and also having sort of problems here with the imagick.so file. ! Because of dumbly "source installing" on a server with CPanel to actually get WebP support.
But you don't need to replicate my way down below maybe all you only need to do:
Is actually to reinstall this module in EasyApache 4 as of speaking:
mod_lsapi
After you reinstall the mod you will be able to reset the php.ini files by that module in the system. Then it is easy to wait for another full error_log which likely wouldn't happen from now.
Option 2:
I've tried to remove all rpm with yum and even PECL uninstall and used ImageMagick as source files that installed the whole system wrong at the beginning. It's hard for the ImageMagick source to find the right place to put the imagick.so file in the extension folder. As it is in another directory with CPanel:
/opt/cpanel/ea-php74/root/usr/lib64/php/modules
You might want to uninstall all .rpm with "!Important that only if you already made that from source in your Cpanel system." That is only when you have tried source install.
yum remove ImageM*
And install from source Imagick. If you can't do it make ImageMagick from source with enabling shared. Also, you will have to remove the module ImageMagick from PECL after making a source install. And make sure imagick.so is still in this directory when the module is still installed with PECL before you uninstall and use source version of ImageMagick:
cp /opt/cpanel/ea-php74/root/usr/lib64/php/modules/imagick.so /root/tmp
cp /root/tmp/imagick.so /opt/cpanel/ea-php74/root/usr/lib64/php/modules
To find your own module folder use:
php -i | grep extension_dir
Remember I've used the php74 version and with CPanel, as this problem only exists for these users of CPanel or users with php74 in a different location. And use the right PHP version instead of php74.
To make the shared enable install ImageMagick source correctly by:
./configure --enable-shared
make
make install