0

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


Anjali Patel
  • 1
  • 1
  • 2

1 Answers1

1

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.

Ofir Baruch
  • 10,323
  • 2
  • 26
  • 39
  • Thank you for your replay.yes you are right.This extension is not available in my phpinfo file. I m using wamp server. What is the solution? – Anjali Patel Mar 18 '19 at 10:01
  • To install it. Here's an answer for installing imagick on WAMP: https://stackoverflow.com/questions/33336327/how-to-install-imagemagick-for-wamp-2-5 – Ofir Baruch Mar 19 '19 at 12:02
  • In case my answer solved your problem, please accept it :) Thanks – Ofir Baruch Apr 06 '19 at 04:53