step-by-step instructions for installing IMAGEMAGICK on WAMP?
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
and here is the dll file where it should be:
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:
- Download ImageMagick Binary Release - http://www.imagemagick.org/script/download.php
- Install in C:\imagemagick, on last step check "Add application directory to your system path"
- Download Imagick DLL: PHP5.6.x version from http://www.peewit.fr/imagick/ (I have 5.6+ version installed on my localhost
- Copy php_imagick.dll to C:\wamp\bin\php\ext
- Download PHP 5.6 Thread Safe (TS) x86 version from http://pecl.php.net/package/imagick/3.1.2/windows
- Copy CORE_RL_* files to C:\wamp\bin\apache\bin\
- Edit php.ini file in C:\wamp\bin\apache\bin\php.ini, add extension=php_imagick.dll line in extensions section
- Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
- Go to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
- Restart Wamp server and check phpinfo() for imagick plugin
- 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
- Open your phpinfo() page
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\Get the latest release match to your architecture from here (for me it was
ImageMagick-x86_64-pc-windows.exe
).Copy all files from C:\imagemagick\modules\coders and C:\imagemagick\modules\filters to C:\imagemagick to load ImageMagick supported formats
Install in C:\imagemagick, on last step check "Add application directory to your system path"
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)
Extract it and copy all the CORE_RL_* files to apache bin folder (mine : C:\wamp\bin\apache\apache2.4.9\bin)
Copy php_imagick.* files to extension dir (mine : c:/wamp/bin/php/php5.5.12/ext/)
Edit php.ini file (mine : C:\wamp\bin\apache\apache2.4.9\bin\php.ini)
addextension=php_imagick.dll
line in extensions sectionGo to Control Panel -> System -> Advanced Settings -> Environment Variables -> New System Variable -> MAGICK_HOME = C:\imagemagick
Restart Wamp server and check phpinfo() for imagick plugin
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:
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/