2017-06-24 12:40
浏览 66

如何在Bitnami的wamp-stack PHP v7.1.4上安装和使用ImageMagick / Imagick

I'm so confused on how to install/enable the use of Imagick on Bitnami's WAMP Stack... I look into php.ini and I see NOTHING about ImageMagick even though there's literally a folder dedicated to ImageMagick called imagemagick :o

When trying to do stuff in my web app, I get this error:

An uncaught Exception was encountered

Type: Error

Message: Class 'imagick' not found

This is my code:

    // Initialize new ImageMagick object
    $im = new imagick($dir_path.'/'.$original_img_filename);

    // Convert to PNG

    // Write image onto server

    // Delete original downloaded image file
    $is_deleted = unlink($dir_path.'/'.$original_img_filename);

Can anyone from Bitnami with knowledge and expertise in Bitnami's WAMP stack please bring to light the solution? It's kind of ridiculous that Bitnami claims it supports ImageMagick for PHP 7.1 but just adds a folder with ImageMagick in the name but with no actual explanation on how to enable it. I've spent countless hours on this. I have all the correct .dll files and added them as extensions in the php.ini file, restarted WAMP and still nothing.

Did it with an absolute file path, local file path, with and without quotes as well as with the back and forward slashes, and tested with and without quotes... EVERY SINGLE POSSIBILITY. I'm not sure exactly why it isn't showing up when I echo out phpinfo().


edit: Figured it out. I had to add SYSTEM VARIABLES.

Had to add a variable named: MAGICK_HOME with the value pointing to the root directory of ImageMagick.

And had to add the same directory to the PATH (and moved it up so that it is above the php one. But im not sure if that is needed. just did it in case.)

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题