If you have cPanel ask cPanel support how to uninstall and install the correct version for each PHP version, because there is a mismatch between the version of ImageMagick installed and the version that Imagick compiles with.
Is this error only generated if you run a specific script?