Fatal error: Uncaught Error: Class 'Imagick' not found in wordpress custom plugin
I am creating wordpress custom plugin and in that i will use 'imagick' class. Here are the sample code that is use in my custom plugin php file:
$imagick = new Imagick();
$imagick->readImage($b);
$imagick->writeImage('output.jpg');
but in that code i have an error like:
Fatal error: Uncaught Error: Class 'Imagick' not found...
Solutions
Fatal error
: Uncaught Error: Class 'Imagick' not found
It means that this class is not defined and therefore cannot be found.
Imagick is a native php extension.
You need to make sure that this extension exists on your server and configured.
You might need your hosting provider assistance for this or in case you have a full access to the server install it by yourself.
Create a php file with the following code:
<?php
phpinfo();
Run it. It should show you all the existing and available extensions on your server. Check that value for Imagick.
Similar questions
Function in WordPress Plugin Not Looking in Path for Imagick
I have inherited a site with a custom plugin that is supposed to decrypt member information and a captured signature and put it into a PDF. The function uses (in this order) TCPDF to create the document; jSignature to convert the decrypted signature to Base30->Base64->Native->SVG; and Imagick to convert the signature to a JPG. Everything works up t...
Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry'
I am having some issues determining the solution to this problem below. The website was sent to our team to fix. Turned on error reporting in wp-config.php: define('WP_DEBUG', true); WordPress Theme: Grow Pro There has been a critical error on your website. Learn more about debugging in WordPress. For privacy reasons, I wouldn't be sharing the live...
Composer class not found fatal error - wordpress plugin development
I am trying to use composer to autoload my classes in a wordpress plugin. I wish for my models and controllers to reside within the GD namespace, however I would like to put my models and controllers into their own directories. I am facing the error message: Fatal error: Class 'GD\ShortcodeController' not found in /.. .../src/GD/App.php on line 10 ...
Also ask