38

How to install image magic in Windows 7. I followed these instruction

To install IMagick on Windows XP (php 5.2.x)

  1. download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ ImageMagick-6.5.8-7-Q16-windows-dll.exe

  2. download php_imagick_dyn-Q16.dll from: http://valokuva.org/outside-blog-content/ imagick-windows-builds/080709/

    copy dll to [PHP]/extension dir and rename it to php_imagick.dll

  3. You have to edit your php.ini file and add new extension

    extension=php_imagick.dll
    
  4. Save ini file and restart apache server.

    (If necessary, restart your windows)

  5. phpinfo() should show imagick enabled.

after that I execute a sample script but its not working. It shows the Imagic class missing error.

Fatal error: Class 'Imagick' not found in C:...\imgborder.php on line XXX

Please help me to install Imagick. :-(

Jonathan
  • 6,741
  • 7
  • 52
  • 69
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
  • 6
    I know this is old, but I ran into this today and it took me forever to get Imagick to work. In my case, setting the `MAGICK_HOME` environment variable was the trick. I wrote up my findings: http://refreshless.com/blog/imagick-pecl-imagemagick-windows Hope it helps anyone. – Lg102 May 17 '14 at 19:10
  • @Lg102 thanks a lot for sharing your knowlegde, I have found your answer as most appropriate for my situation. – iamawebgeek Jul 18 '14 at 12:31
  • The tutorial at http://.com/blog/imagick-pecl-imagemagick-windows/ was the only one that helped me setting up things, thanks a lot. – Avatar Dec 15 '14 at 18:31
  • 2
    http://valokuva.org/outside-blog-content/ is a broken link. – Goose Nov 17 '15 at 14:52

6 Answers6

12

Check permissions on the .dll file to make sure the Apache user has read access to the file. Better change the permission of the [PHP]/extension directory.

To change the permission

  1. Right click the file(s) or folder(s)
  2. Select "Properties"
  3. Select "Security" tab
  4. Click on "Edit" button.

Change the permission of user to Full Control.

chanchal1987
  • 2,320
  • 7
  • 31
  • 64
7
  • Download the binaries on the PECL page (look for the "DLL" links).
  • Open the archive, copy all the *.dll files to the "php\ext" directory.
  • Add the extension to your php.ini:

    • Usually you should add extension=php_imagick.dll.
    • On some WAMP platforms, it might be instead extension=ext/php_imagick.dll. Just look how the existing extensions are defined and do alike.
  • Restart web server.


At this point, Imagick is installed, but you will probably encounter this error:

ImagickException: NoDecodeDelegateForThisImageFormat

It means you have to install ImageMagick as well:

  • On this page, download the ImageMagick archive corresponding to the Imagick you have installed (MSVC version, CPU architecture).
  • Open "bin" directory of this archive, copy the *.dll files to the "php\ext" directory. For example, you'll need IM_MOD_RL_jpeg_.dll for JPEG handling.
Gras Double
  • 15,901
  • 8
  • 56
  • 54
  • this worked for me, but in the last steps, after copying .dll files. I still get the error `unable to load module .. IM_MOD_RL_PDF_.dll`, any thought?? – azerafati Nov 30 '15 at 12:06
  • 1
    One possibility is that the files are compiled with different versions of MSVC. Also, a note has been added in Imagick README: [Installing on Windows](https://github.com/mkoppanen/imagick#installing-on-windows). Check out the files they are linking to. – Gras Double Dec 01 '15 at 01:09
  • @Bludream I have updated my answer following our comments above. Does it work for you now? – Gras Double Dec 05 '15 at 03:11
  • 3
    I prefer to copy all the DLL files from ImageMagick's bin folder to it's own folder somewhere and just add that folder to my PATH environment variable. Then I don't make a mess in the php/ext folder. – TheStoryCoder Jun 09 '16 at 07:09
3

Here are Windows binaries for imagick 2.3.0 compiled with VC6 (you can find VC9 binaries at Mikko’s blog) against PHP 5.3.2 (API20090626).

Try this link

i0707
  • 617
  • 1
  • 6
  • 14
2

I've research this solution, here you will find all necessary libraries. Download this http://image_magick.veidrodis.com/image_magick/binaries/ImageMagick-6.6.2-10-Q16-windows-dll.exe

Find your DLLs here http://www.peewit.fr/imagick/

To know which library fit your needs easily run phpinfo()

There you find the following row e.g.

Compiler MSVC9 (Visual C++ 2008)

The MSVC9 tells you that it's compiled with Visual C9, so you need to download the VC9 version. Thats all.

Have nice day, takes me several hours of research.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
funktioneer
  • 456
  • 1
  • 6
  • 13
2

This may be hitting a nail with a 5-pound hammer, but I like Cygwin, a Unix-like environment for Windows; it includes imagemagick as a package.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
2

Just use chocolatey

choco install imagemagick

Done

Jonathan
  • 6,741
  • 7
  • 52
  • 69
  • 1
    So you recommend installing another piece of software to install Imagemagick? Imagemagick installs without a problem and if you read the question fully the OP is having a problem with Imagick. Basically the confusion comes from the OP's question title and tags. I have added the Imagick tag and Imagick to the title. – Bonzo May 15 '17 at 07:55
  • @Bonzo Technically you don't have to install chocolatey as a seperate peice of software anymore, Windows Powershell now has the ability to set chocolatey packages as a repository, then you can install imagemagick via powershell, which is built into windows. – Jonathan Jul 26 '18 at 21:35
  • @Bonzo you're right about his title/tags. I recommended a title edit – Jonathan Jul 26 '18 at 21:37