0

I am trying to install ImageMagick for MAMP 4.

My php version is: 7.1.19 I went to applications/MAMP/bin/php/php7.1.12/conf/php.ini and changed this line ;extension=imagick.so to extension=imagick.so. I also have a php folder in there of php7.2.1 so I did the above change there too. I restarted MAMP.

After doing that phpinfo told me that ImageMagick is present:

enter image description here

However when I try to run a line of code like this:

header('Content-type: image/jpeg');

$im = new Imagick("test.png");

I received the error localhost is unable to handle this request, if I remove these lines of code then the page loads fine.

I have also installed ImageMagick, imagemagick 7.0.8-14 is already installed and up-to-date.

Otto
  • 663
  • 3
  • 17
  • 33
  • 2
    You need to tell PHP that the Imagick namespace is built-in with a back slash: `$im = new \Imagick("test.png");` Note back slash before Imagick – Jamie_D Nov 10 '18 at 13:42
  • Possible duplicate of [How to get useful error messages in PHP?](https://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php) – miken32 Nov 10 '18 at 18:56

0 Answers0