简体   繁体   中英

How to make ImageMagick Imagick class available?

This is a really amateur question but I've installed ImageMagick from the ports on my FreeBSD.

However when I use

$image = new Imagick($filename);

I get:

Fatal error: Class 'Imagick' not found in /usr/local/www/test.php on line 1

How do I make this class accessible to the scripts?

pecl install imagick

See the manual .

You installed the ImageMagick suite itself, which does not provide any interface to PHP. You also need to install the PECL Imagick extension.

FreeBSD has a port available for this - graphics/pecl-imagick .

You will also need to get/build the accompanying PHP library that interfaces with Image Magick. Then add it to your php.ini with something like:

extension=php5-imagick.so

There is also a OS X / Darwin port available here .

apt-get install imagemagick && apt-get install php-imagick

(Ubuntu的)

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