6

using Laravel and trying to work on image upload using Imagine.

The issue is that I get the error stating:

Imagine \ Exception \ RuntimeException

Imagick not installed
Open: /Applications/MAMP/htdocs/laravelcms/vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php

{
/**
* @throws RuntimeException
*/
public function __construct()
{
if (!class_exists('Imagick')) {
throw new RuntimeException('Imagick not installed');
}

I followed this guide, and correctly created all the folders and files etc as stated:

http://creolab.hr/2013/07/image-manipulation-in-laravel-4-with-imagine/

I have also checked the the Imagick folder with all files etc is in the correct location.

Any help?

Thanks, Craig.

Lovelock
  • 7,689
  • 19
  • 86
  • 186
  • Is Imagick in your `phpinfo();`? – cwallenpoole Oct 15 '14 at 21:53
  • You didn't install imagemagick extension. Follow the instructions [here](http://php.net/manual/en/imagick.setup.php). – N.B. Oct 15 '14 at 21:54
  • I see, and its not in my phpinfo. Thought it was already part of laravel but now i see its more to with the installed version of php. Shall install it thanks – Lovelock Oct 15 '14 at 21:58

4 Answers4

8

After some research, I found that MAMP 3 comes with Imagick pre-installed but not enabled by default.

Simply edit the php.ini file and search for:

;extension=imagick.so

Remove the ';' before it.

Lovelock
  • 7,689
  • 19
  • 86
  • 186
  • 1
    It is enabled by default at least in MAMP 3.3.1 (Windows): `C:\MAMP\conf\php7.1.5\php.ini` `extension=php_imagick.dll` – qräbnö Aug 23 '17 at 11:25
1

If you have in fact installed it and it is still not working, a web server restart should do the trick. Cheers.

Marcel Gruber
  • 6,668
  • 6
  • 34
  • 60
1

Also for all other: do not forget that artisan will probably use separate php.ini, so will need to include extension=imagick.so there as well.

gorodezkiy
  • 3,299
  • 2
  • 34
  • 42
0

The most likely cause is that you don't have Imagick installed. It does not come enabled on MAMP natively, so that is not surprising. There are instructions on how to add it to MAMP here.

cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
  • Thanks, just got my head around composer now looking at ghost etc haha. Shall be a long evening. Thanks. – Lovelock Oct 15 '14 at 22:03