简体   繁体   中英

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


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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM