step-by-step instructions for installing IMAGEMAGICK on WAMP?

62,675

Solution 1

I know this is old post but I spend my all day to make it work, so here are the steps that helped me:

  1. Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
  2. Install in C:\imagemagick, on last step check "Add application directory to your system path"
  3. Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
  4. Copy php_imagick.dll to C:\wamp\bin\php\ext
  5. Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
  6. Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
  7. Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
  8. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
  9. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
  10. Restart Wamp server and check phpinfo() for imagick plugin
  11. If last step does not work, restart Windows

Solution 2

I have improved fsasvari answer to cater general scenarios and versions. All credits to him.

Install Imagick in WAMP

  1. Open your phpinfo() page
  2. Check the below
    PHP version (mine : 5.5.12)
    Compiler (mine : MSVC11 (Visual C++ 2012) )
    Architecture : (mine : x64)
    Thread Safety : enabled
    Loaded Configuration File (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    extension_dir : (mine : c:/wamp/bin/php/php5.5.12/ext/)
    Apache Bin (Not in phpinfo() page) : C:\wamp\bin\apache\apache2.4.9\bin\

  3. Get the latest release match to your architecture from here (for me it was ImageMagick-x86_64-pc-windows.exe).

  4. Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats

  5. Install in C:\imagemagick, on last step check "Add application directory to your system path"

  6. Download the PECL matching to your architecture http://pecl.php.net/package/imagick/3.1.2/windows (for me : 5.5 Thread Safe (TS) x64)

  7. Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)

  8. Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)

  9. Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
    add extension=php_imagick.dll line in extensions section

  10. Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick

  11. Restart Wamp server and check phpinfo() for imagick plugin

  12. If last step does not work, restart Windows (Specially if you have previously installed imagemagick in different folder/version)

Solution 3

For WAMPSERVER 3.1.9 64bit, PHP Version: 7.3.5

I had a lot of trouble with this as well and some things I did wrong was that I doubted ImageMagick would load on my new php version. But you have to believe it will work and don't try with older php versions :)

So this was my approach, remember to follow it with your own settings and versions/folders.

Before you start, make sure you running the php version you want to run. If you installed Wampserver 3, you may click the wamp icon and go to php version and activate the one you want to run.


1

Get latest ImageMagick version for your system here: http://ftp.icm.edu.pl/packages/ImageMagick/binaries/

(I got the ImageMagick-x86_64-pc-windows.exe in the bottom)


2

Install ImageMagick in C:/imagemagick (I put it in lower cases), You will be asked for some stuff during install, just make sure the path thingy is ticked.

You should also tick the convert thingy if it allows you.

Then after install you can run CMD and type convert -version to see if imagick is installed.


3

Run <?php phpinfo(); ?> And find out these settings:

PHP Version: 7.3.5

System: Windows

Compiler: MSVC15 (Visual C++ 2017) ([VC15])

Architecture: x64 (or maybe you have x86)

Thread Safety: enabled ([TS] else [NTS])

You probably have other settings, but you need to remember yours to download the proper php_imagick.dll


4

Get the php_imagick.dll you want for your php version from here: http://pecl.php.net/package/imagick

I got mine from here: http://pecl.php.net/package/imagick/3.4.4/windows for php 7.3

Remember your info from the phpinfo(), it has to match, else it won't work.


5

After you unzip it, copy the php_imagick.dll and paste it in C:/wamp64/bin/php/php7.3.5/ext/

Then copy all the other .dll files from that folder into C:/wamp64/bin/apache/apache2.4.39/bin/

Yes it's dirty but you will get it working like this.


6

Add extension=php_imagick.dll in C:/wamp64/bin/php/php7.3.5/phpForApache.ini

I added it after the other extensions in the file.


7

Restart all Wamp services.

If you been messing around earlier with installs, you might have to restart the computer due to some weird cache stuff.


8

Check phpinfo() again if imagick shows up and try something like $im = new Imagick();


9

Click the Wamp icon -> php -> extensions, php_imagick should be listed.


Good luck! :)

Solution 4

This was a headache for me as well, but unfortunately I installed this quite awhile ago. The instructions from that link you posted seem accurate. Have you ran phpinfo(); to see if it is installed in the Apache Environment? It should be listed as MAGICK_HOME.

Make sure "SetEnv MAGICK_HOME C:/imagemagick" is set at the end of your httpd.conf file. Assuming imagemagick is installed in that directory.

Be sure that you have the extension "php_imagick.dll" in your php.ini file as well.

It should work just fine if you have all those set.

On another note, here is a nice little library someone built to make imagick easier to use. https://github.com/francodacosta/phmagick

I hope that helps! Good luck!

Solution 5

PHP 5.4 php_imagick.dll is here: http://www.peewit.fr/imagick/ . I read somewhere that 64bit php doesnt work with php_imagick. That might be the case when you get this error in apache_error.log

PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
%1 is not a valid Win32 application.\r\n in Unknown on line 0

As mentioned above, it was also necessary to add this into httpd.conf (also, i read you cant have spaces/dashes/dots):

SetEnv MAGICK_HOME C:/imagemagick"

If you dont, you might get this error:

"PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_imagick.dll' -
The specified procedure could not be found. in Unknown on line 0"

In the end, this article might partially help: http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/

Share:
62,675
Haroldo
Author by

Haroldo

Updated on July 09, 2022

Comments

  • Haroldo
    Haroldo almost 2 years

    There don't seem to be any concise tutorials/walk throughs for installing ImageMagick on WAMP for use with PHP.

    I've tried dozens of combinations of their binary releases with different php extension dll files. I can get imagemagick working fine from the command line, and I can get it to show as ticked in the WAMP extensions, but can't actually use it.

    Has anyone come across a good guide for installing this ball ache piece of software?

    I've followed http://www.knowledge-transfers.com/it/installing-imagemagick-on-windows-setup-imagick-on-php with no luck...


    Update: this is what happens when I follow the steps in PHP farmer's answer on windows7. My php.ini is setup as follows:

    extension_dir = "c:/wamp/bin/php/php5.3.0/ext/"
    
    extension=php_imagick.dll
    

    I reboot and get these two errors in this order

    alt text alt text

    and here is the dll file where it should be:

    alt text