Saturday, February 18, 2012

WAMP Server and ImageMagick

Update 9/5/18 - This is more than likely widely outdated. You're probably better off using XAMP over WAMP.

Edit: If you're running x64 bit version of Windows 7 you will need to install wamp, imagick, and php_imagick.dll ALL as x32 bit.

I decided to write this tutorial because this gave me a massive headache for three hours and I want others to not have to go through what I did.

There's millions of guides about this on the internet, but they all seem to be missing one crucial thing.



The .dll file (which we will get to later) MUST be compiled in VC9, or it will not work with php 5.3.5.

My Guide to Install ImageMagick on WAMP Server:


1. Download ImageMagick for Windows here: http://www.imagemagick.org/script/binary-releases.php?ImageMagick=p7k0tc2pra2nbmrgs423c5gsh6#windows (Select the first one on the list ImageMagick-6.7.5-6-Q16-windows-dll.exe)

2. Install to directory C:\imagemagick


and when prompted with a list of selections, choose everything but "Install PerlMagick for ActiveState Perl v51412.2 build 1402" as it causes the installation to error out.


3. Download the VC9 compiled .dll for windows here: http://valokuva.org/builds/

4. Move the downloaded VC9 compiled .dll to this directory: C:\wamp\bin\php\php5.3.5\ext
       *Note: This is the default install directory, it may be different for you.

5. Open up php.ini in a text editor by navigating to (default) C:\wamp\bin\php\php5.3.5\php.ini or by clicking on the WAMP tray icon and selecting php then php.ini.

6. Now that you are in php.ini and editing it, scroll til you find a list of extensions (see picture)

7. After finding the list, add "extension=php_imagick.dll" (without quotes) to the list, as I did above.
     *Note: Do not put a ";" in front of it as it will be commented out.

8. Unfortunately ImageMagick also has issues working with Apache version 2.2  so you need to downgrade to 2.0.63. Don't worry, it's a lot easier than it sounds.

9. To downgrade to Apache 2.0.63 click on the WAMP tray icon, hover over Apache, then Version, then click "Get more..."


9. You will be directed to the WAMP server website, (it may be in French so you can click the English button  in the upper right corner to change it.)

10. Locate and click on "Download Apache Add Ons".

11. In the window that comes up, click on Apache 2.0.63.

12. You will be redirected to a download page, let it download and install it.

13. Start WAMP server again, click on the tray icon, hover over Apache, then click Apache 2.0.63 (Like the image above)

14. Restart all services within WAMP. (Click on Icon, select restart all services).

15. You should now be able to use ImageMagick with no problem.


Hopes this helps anyone that is having issues. Took me a while to figure it out, but thanks to a friend of mine and going through all the steps over and over again, I finally figured out a way to get it working.