PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 19, 2022

[FIXED] How to install and use ImageMagick/Imagick on Bitnami's wamp-stack PHP v7.1.4

 September 19, 2022     bitnami, imagemagick, imagick, php, wamp     No comments   

Issue

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
    $im->setImageFormat('png');

    // Write image onto server
    $im->writeImage($filename.'.png');
    $im->clear();
    $im->destroy();

    // 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().

Thanks.

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


Solution

Figured it out AFTER HOURS OF FRUSTRATION AND BREAKS. Sorry.

Anyways I had to add SYSTEM VARIABLES (in addition to adding the dll extension in php.ini).

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



Answered By - radiantMemory
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing