PHP Imagick UwAmp installation not working - php

I've been browsing net few days, however I haven't find the solution to my problem yet. So here I am, asking my first stackoverflow question ever:
I need to install imagick to my UwAmp local server.
My current imagemagick version: ImageMagick-6.8.9-1-vc9-x86
I have Windows 7 x64, but neither x64 version of ImageMagick made my local server run the imagick. In command line, ImageMagick is working OK.
My PHP version: 5.4.31
The extension is listed in UwAmp list of extensions, but when i run PHPinfo there isn't a single word about imagick. My Apache error log doesn't print any error associated with loading problems.
When I run the test file, it prints out: Fatal error: Class 'imagick' not found.
I have tried bunch php_imagick.dll files for various versions of PHP, for x64 wamp server, for x86 one etc. The solutions I have found doesn't solve it. Neither do the step-by-step tutorials.
Have you experienced this problem so far? What php_imagick.dll file would you recommend me to try?
Thank you for you help, Michael
EDIT: my UwAmp version is 32 bit

Detailed guide for newbies like me.
Took a long time to get it to work.
I initially followed:
http://php.net/manual/en/imagick.installation.php
but after installation, PHPInfo under imagick shows
number of supported formats = 0
So I followed these steps, clobbered from various sources
to get it to work.
Click PHPInfo and check:
Architecture = x86 or x64
Thread Safety = yes or no
Download ImageMagick from:
http://windows.php.net/downloads/pecl/deps/
In my case I downloaded: ImageMagick-6.9.3-7-vc11-x86.zip
because the Architecture under PHPInfo is x86
as for vc11 or vc14
search google for "visual c++ 11 runtime" or
"visual c++ 14 runtime" and install it
Unzip and copy all dlls from the bin subfolder to the
Apache bin directory. It's a bunch of CORE_RL_.dll
and IM_MOD_RL_.dll plus a few other dlls.
In my case, I installed UwAmp in C:\UwAmp, so:
(from zip) bin/*.dll --> C:\UwAmp\bin\apache\bin
Goto:
http://pecl.php.net/package/imagick
as of today, latest is 3.4.1 so I went to:
http://pecl.php.net/package/imagick/3.4.1/windows
My PHP version is: 5.6.18, and Thread Safety is Yes from
Step #1, so I downloaded:
5.6 Thread Safe (TS) x86
and got: php_imagick-3.4.1-5.6-ts-vc11-x86.zip
Unzip and copy "php_imagick.dll" to the php extension folder:
In my case:
php_imagick.dll --> C:\UwAmp\bin\php\php-5.6.18\ext
Note: this ZIP also contains dlls which other guides says
to extract to the extension folder of apache.
NO NEED TO DO IT. Step #3 has taken care of it.
Edit "php.ini" and add:
extension=php_imagick.dll
or (I placed it at the very end):
[Imagick]
extension=php_imagick.dll
For super newbies: click the edit button in the UwAmp UI,
"php_uwamp.ini" will open and edit it. It will be copied to
the correct php.ini when UwAmp is restarted. I had
trouble at first since there are several php*.ini scattered
all over.
Restart Apache
Check PHPInfo
scroll to section (or find): imagick
number of supported formats: 234 (on mine)
If there is no "imagick" section or "supported format" is 0,
something went wrong.
Hope this helps.
BTW, the comment to the question by "Gras Double" works,
just wish I had found it earlier.

Related

How to install php_imagick on wamp64

I've been trying to install php_imagick on wamp64 without any luck.
The desired goal is for WordPress to stop showing the error message:
The optional module, Imagick, is not installed or has been disabled.
You can also skip reading and view the images attached below.
My setup:
Wamp64 Windows 10 Release Version 3.2.3.3 64 Bits [Windows Build: 19041]
PHP Version: 7.4.9
Build Date: Aug 4 2020 11:45:36
Windows: NT *username* 10.0 build 19041 (Windows 10) AMD64
Compiler Visual: C++ 2017
Architecture: x64
Loaded Configuration File: C:\wamp64\bin\apache\apache2.4.46\bin\php.ini
Thread Safety: enabled
I tried installing the following ImageMagick files:
1) ImageMagick-7.0.10-30-Q16-HDRI-x64-dll.exe
----A) php_imagick-3.4.3rc1-5.6-ts-vc11-x64.zip
----B) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
2) ImageMagick-7.0.10-30-Q16-x64-dll.exe
----A) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
----B) php_imagick-3.4.4rc2-7.3-ts-vc15-x64.zip
3) ImageMagick-6.9.3-7-Q16-x64-dll.exe (Current)
----A) php_imagick-3.4.4rc2-7.3-ts-vc15-x64.zip (Current)
----B) php_imagick-3.4.3rc1-7.1-ts-vc14-x64.zip
----C) php_imagick-3.4.3rc1-5.6-ts-vc11-x64.zip
What I did:
I first installed the EXE file and then extracted from the zip file just the php_imagick.dll file into this folder:
C:\wamp64\bin\php\php7.4.9\ext
Which matches my currently used PHP version (see images later for more information[php.ini]).
I tried restarting Wamp, rebuilding symlinks by switching PHP/Apache versions.
Will also be worth mentioning that I at one point tried extracting the full zip into the 'ext' folder under a folder named 'php_imagick' as shown below and did manage to get this error:
C:\wamp64\bin\php\php7.4.9\ext\php_imagick\php_imagick.dll (The specified procedure could not be found.)
but mostly I receive these errors:
[25-Sep-2020 08:58:50 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_imagick.dll' (tried: c:/wamp64/bin/php/php7.4.9/ext/php_imagick.dll (The specified module could not be found.), c:/wamp64/bin/php/php7.4.9/ext/php_php_imagick.dll.dll (The specified module could not be found.)) in Unknown on line 0
When I install Magick using the EXE, I make sure to check the install to the path, Change the folder to C:\ImageMagick, and install the legacy drivers if possible, as suggested on Stack OverFlow.
(I also make sure to uninstall the last version I tried each time)
I have Visual Studio installed and a bunch of redistributables and also both x86 and x64 versions of these:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
http://www.microsoft.com/en-us/download/details.aspx?id=30679
Without any luck, I went ahead and read several Stack OverFlow posts and could not find a solution.
How to install ImageMagick with Wampserver 3.0.0 64?
step-by-step instructions for installing IMAGEMAGICK on WAMP?
Installing php_imagick.dll PHP extension on wampserver 2.2
Unable to install php_imagick.dll on wamp
Imagick delegates installation on WAMP
How to install ImageMagick with Wampserver 3.0.0 64?
step-by-step instructions for installing IMAGEMAGICK on WAMP?
Installing php_imagick.dll PHP extension on wampserver 2.2
Unable to install php_imagick.dll on wamp
Imagick delegates installation on WAMP
WAMP PHP Startup Error: Unable to load dynamic library
Installing ImageMagick extension with php/windows
Linker error when trying to use ImageMagick as static libraries with Visual Studio compiler
Installing Magick++ in Visual C++ 2010
Installing Magick++ in visual studio 2019
ImageMagick with Visual Studio
WampServer and Imagemagick, imagick php module not recogized
Cannot load imagick library
ImageMagick not working
What can I try next?
typo in line 955: .php=.dll
I hired a freelancer to fix this for us.
Uninstall any versions of WampServer and ImageMagick you have installed
Don't forget to backup your database and www folder before you uninstall
We are going to install a trustable software called Chocolatey that will help us fix a bunch of errors with Wamp64 and it's extensions as well as help us update those applications with one command.
For those of you who already fixed this before using Chocolatey and
now seeing this error message again simply update Wamp and ImageMagick
using the choco commands provided on their website and then read my
note under 4) for more information
Run PowerShell as Admin
Follow this guide to Download chocolatey https://chocolatey.org/install
Use the same methods to Download Wamp64 https://chocolatey.org/packages/wamp-server
Run Wamp from the newly created shortcut on your desktop
Change the PHP version to 7.4.9 or the latest and only then move
to the other steps
Don't worry about the fact the folder is named Wamp and not Wamp64. It's still the 64bit version. You can check this in the about section of Wamp
Download https://chocolatey.org/packages/imagemagick
Download https://windows.php.net/downloads/pecl/deps/ImageMagick-7.0.7-11-vc15-x64.zip
Note: If that doesn't work, they probably updated again. Just try the same methods using newer versions then these. I will first try more recent versions of php_imagick instead of replacing the ImageMagick core DLL files. One thing I will not do is give up.
Extract And Copy all CORE_RL and IM_MOD_RL DLL files into C:\wamp\bin\php\php7.4.9 where php.exe is located
(Do not run any EXE file from here as we already installed ImageMagick)
Download https://windows.php.net/downloads/pecl/releases/imagick/3.4.4/php_imagick-3.4.4-7.4-ts-vc15-x64.zip
Extract and Copy just the php_imagick.dll file to C:\wamp\bin\php\php7.4.9\ext
Open your php.ini file by left-clicking Wamp->PHP->php.ini and then make sure you delete all leftovers and add below any extention= line the code below:
extention=imagick
(Apparently, New PHP versions require writing it without the "php_"...".dll" parts)
Restart Wamp by closing it and reopening it from its shortcut
This is by far the only solution I could get running.
choco:
Google = https://www.google.com/search?q=chocolatey
2019 = http://web.archive.org/web/20190101113929/https://chocolatey.org/
2018 = http://web.archive.org/web/20180414000310/https://chocolatey.org/
Enjoy
I use wampserver 3.2.3 64bit together with PHP 7.3.
Copying the CORE_RL and IM_MOD_RL DLLs into the PHP root direcory as orr burgel recommended in item #5 did not work for me.
I had to copy these DLLs into c:\wamp64\bin\apache\apache2.4.41\bin.

How to enable curl in php 7.3+ in uwamp server

I'm running Uwamp server under windows7 and it works perfectly with php versions from 5.5 to 7.0.3 and with curl enabled.
When I switch to php 7.2, 7.3 or latest 7.4.3 uwamp server still working - but without curl.
php_curl.dll file is enabled under extensions (ext) but phpinfo() confirms that curl extension is missing / not enabled. I compared php.ini with previous php versions, modified it but it still doesn't work.
cURL is NOT installed on this server
I have testet xampp and this server has no problem with curl and php 7.3/7.4. I compared php.ini etc. but curl extension still not working under Uwamp.
It seems that the author of the project has abandoned it, because there have been no updates or activities since many years. Maybe someone using it and can help me to solve it.
Any idea would be greatly appreciated!
finally got a working solution for this problem of uwamp and running an up to date version of php and getting curl working.
I have sat here for a couple of days trying to work why you couldn't get a later version of php 7.0.3 without breaking uwamp and curl. So I learnt how to integrate and test php apache as standalones and then working on updating uwamp. Lots of head scratching of working out how uwamp uses its on the fly configuration setup.
I will list all the steps to update your version of uwamp (to apache 4.2 and php 7.4.4 as of Mar 2020)
Download uwamp (portable or installer)
Download c++ runtime https://aka.ms/vs/16/release/VC_redist.x86.exe (taken from the windows php page)
Install the runtime above
Install uwamp to a directory (in this example will just use c:\ making it install to c:\uwamp after expanding)
Before running uwamp
Goto to apache lounge website and download the latest 32 build of apache (4.2)
https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.41-win32-VS16.zip
Expand this archive, it should create a folder called apache2.4
Step in to this directory and copy all the files and paste them here in your uwamp folder (c:\uwamp\bin\apache). This should overwrite all the apache files and add the latest apachephp dll
TIP. Just make sure you havent expanded the apache2.4 zip in the uwamp apache folder, easy to tell as you will see a apache24 appear
Goto to php.net and download the latest THREAD SAFE version of php (7.4.4)
https://windows.php.net/downloads/releases/php-7.4.4-Win32-vc15-x86.zip
Extract the php zip this folder in to the c:\uwamp\bin\php in to a new folder with name of php-7.4.4 (so the files should be in c:\uwamp\bin\php\php-7.4.4)
There you are, you have completed your manual upgrade of uwamp , run uwamp and if no errors appear with in the GUI, everything should be working. Test by opening a browser and use http://localhost/uwamp/phpinfo or http://127.0.0.1/uwamp/phpinfo or click the "phpinfo button" in the uwamp GUI
This way seems to allowed an upgrade of uwamp (except sql) but resolve a common problem of php and curl not working / breaking.
This works for x86 version installed on a 32/64 bit system.
Still trying to work out the kinks for uwamp to be running 64 bit apache and php but should be possible.
Try and delete the version of PHP that is affected by the missing Curl extension and then re-download the version from inside the AWamp interface. I have had similar problems with other extensions and have solved it this way.

Imagick php windows

I am trying to use iMagick in Symfony2.
I am using PHP 5.4.16 and all i have done :
1-Copy php_imagick_nts.dll from php5-4 directory from the extracted http://valokuva.org/~mikko/imagick-php54-php53.tgz to php/ext .
2-Rename it to php_imagick.dll and add the “extension=php_imagick.dll” to php.ini
3-Create a page like this :
<?php
$a = new Imagick();
?>
but i receive this :
Fatal error: Class ‘Imagick’ not found in C:\xampp\htdocs\info.php
When I tried to use this in a symfony controller, the error occur again:
FatalErrorException: Error: Class 'Imagick' not found
Unfortunately the details about imagick extension not appear in output of "phpinfo()"
Is this version is incompatible with PHP 5.4.16 ?! If yes,what version i must use? Where? Thank for any help...
After trying many solutions, none seemed to work.
I managed to install it on Windows 10 64-bit, Apache 2.4 and PHP 5.6, but I think it should work for all versions.
Hopefully you will have no problem installing Imagick for PHP.
Step 1) Gather information
First of all you should gather some information of your PHP environment.
You can easily see your PHP information with the function phpinfo()
The information you need:
Architecture: x86(32-bit) or x64(64-bit)
PHP-version: you can find this in the header of the phpinfo() output.
PHP Extension Build: This string contains 2 important parts:
NTS or TS
VCx (like VC11)
Loaded Configuration File: the path to your used php.ini file.
Step 2) Download Binary
You can download the binary from the official site of ImageMagick. I recommend you to read the small introduction under the "Windows Binary Release" to be certain which "bits-per-pixel" to choose from(8 or 16).
Downloading the latest version should be just fine.
Make sure this binary is the same architecture as your PHP architecture that you have gathered in step 1.
Step 3) Install Binary
Install the binary to your phpx.x.xx\bin file. For example: C:\wamp64\bin\php\php5.6.16\bin. (This can be any folder, but for the convenience I put in here)
Make sure "Add application directory to your system path" is checked. Should be checked by default though.
Step 4) Download PHP extension
The DLL PHP extension is available through the windows pecl php site
Again, you can just click the latest version.
Next of, choose the right version based on the gathered information.
For example: php_imagick-3.4.1-5.6-nts-vc11-x64.zip
This can be stripped into components:
php_imagick-3.4.1 - This is the php imagick extension with the version. This is not important.
5.6 - This is your PHP version and should be equal to the PHP-version you are using, which you have determed in step 1.
NTS - This should be equal to the information of your PHP Extension Build that you have gathered in step 1.
VC11 - This should also be equal to the information of your PHP Extension Build that you have gathered in step 1.
x64 - This the architecture of the extension and should be equal to your PHP architecture that you have gathered in step 1.
Step 5) Extract PHP Extension
After you have downloaded the file, you should open the .zip file and look for a file named: php_imagick.dll.
Extract this file to phpx.x.xx\ext.
Make sure the .dll file is fully accessable by you. Sometimes you need to explicity unblock the file.
Step 6) Activate PHP extension
To activate the extension in PHP, you should state in your php.ini file that you want to use this extension.
You have gathered the path to your used php.ini file in step 1.
Add the line extension=php_imagick.dll to your php.ini
Step 7) Restart your PC
Just to make sure, restart your PC so all Environment Paths will be correctly loaded.
This should install Imagick correctly with the latest versions and the right architecture.
Imagick should also be listed in phpinfo() with the appropriate "ImageMagick supported formats" (Just make sure it is not empty).
I spent many hours trying to make Imagick work, finally I got it.
My installation instructions
Install WAMP 32bit (even if you running 64bit system you must use 32bit version of WAMP)
Install ImageMagick to C:/imagemagick, use this file: https://www.dropbox.com/s/i2mhrhd7sp0ilzk/ImageMagick-6.8.0-3-Q16-windows-dll.exe
Put DLL with Imagick into extension folder of PHP, e.g. D:\wamp32\bin\php\php5.4.16\ext, I used this file: https://www.dropbox.com/s/ayankf850l08rm2/php_imagick.dll
In php.ini put line "SetEnv MAGICK_HOME C:/imagemagick" without quotes
Better restart PC
I use Wamp 2.4, PHP 5.4.16, Apache 2.4.4, ImageMagick 6.8.0-3 2012-10-24 Q16, Imagick 3.1.0RC2 - all 32bit, OS Win8 64bit
Now it should work and you should see Imagick extension loaded in phpinfo.
I tried a lot of versions of ImageMagick, but newer versions didn't work, 6.8.0-3-Q16-windows-dll works fine.
Symfony2
In Symfony2 use Imagick like this:
$im = new \Imagick('image.jpg');
I'm quite sure this is to do with not having the module loaded correctly or the .dll being placed in a improper location.
You can use PHP's internal function extension_loaded() to check prior to using the class,
<?php
/**
*
**/
if (!extension_loaded('Imagick')) {
//Load some error.
}
?>
That's a method you can check if the module is even being reconsigned by PHP at all.
PHP also provides a function to view your current extensions get_loaded_extensions():
<?php
/**
* Get an Array of current
* PHP extensions for debugging
**/
print_r( get_loaded_extensions() );
?>
Make sure you do:
Check your correct extension library folder location within your phpinfo()
Perform a hard restart of your xmapp/wamp server.
If you're on PHP 5.4 or upwards (Like yourself!), see site below for the updated binaries
After researching too, Imagick does seem to have trouble with PHP 5.3 or upwards; Download new DLL's from this site below (Unofficial):
http://www.peewit.fr/imagick/
Also found other StackOverFlow Articles that have the same problem:
Stackoverflow: Trying to get imagick running on PHP 5.4.3 at Windows x64
Alternatively you're able to use the GD extension to more or less accomplish some of the same functions you require. I do believe GD is a more widely supported module/extension in more recent versions of PHP.
For those using Windows 10 with PHP 7 the following might help:
determine whether your Windows is threadsafe (see the output of phpinfo()) and 32 or 64 bits.
This page contains matching sets for each php version and threadsafe and 32/64 settings. Download both the Imagick and the Imagemagick files.
Follow for Imagick the instructions at the bottom of that page.
For ImageMagick the instructions on that page are not correct. You can put the dll files anywhere but you need to refer to them with the MAGICK_HOME windows environment variable. You may need to reboot for the change of the environment to have effect.
I use :Wamp 2.4, PHP 5.4.16, Apache 2.4.4, ImageMagick 6.8.0-3 2012-10-24 Q16, Imagick 3.1.0RC2 - all 32bit, OS Win7 32bit
Instructions given by fmstoun worked for me perfectly.
Since I spent a lot of hours trying to make the dll work, I wanted to add on to steps given by fmstoun.
Do restart your PC.
Use the full path to the image, for example:
$image = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/images/test.jpg');
Make sure your system environment has 1 single entry for : C:/imagemagick and no more environment variables for imagemagick. If any previous installations have the path, then remove those paths and restart your PC
Make sure http : / / localhost/ of wamp shows 'imagick' as loaded extension
If extension is loaded properly, it has to show up in phpinfo() also as:
imagick module | enabled
ImageMagick version|ImageMagick 6.8.0-3 2012-10-24 Q16 and some more information about imagemagick.
Considering the date of this post, the latest version of imagemagick provided on the official site is: ImageMagick-6.8.8-1-Q16-x86-dll.exe
which fails to load the extension (as seen in apache error logs after a restart).
Hence use the version mentioned by fmstoun.
Hope this answer saves couple of hours of effort and saves time required to go through around 15 SO questions on same topic and also different forums.
UPDATE for those 2019 also using WAMP, a much more simplier method of ImageMagick are as follows:
Go to https://mlocati.github.io/articles/php-windows-imagick.html.
Grab a copy of the .dll extension file of your appropriate setup, choose a "Threads Safe" version.
Grab the corresponding ImageMagick using the link on the same row and install it.
Copy only the .dll file to the extensions folder of your install of WAMP, usually C:\wamp\bin\apache2.4\ext\
Restart apache.
Hope this helps.
Sorry for my bad english:
1º Install Appserv
Filename: "appserv-win32-2.5.10.exe"
URL download: h*ttp://www.appservnetwork.com/ (without *)
Apache port: 8080
2º Download PHP 5.3(Apache 2.2 doesn't support superior)
Filename: "php-5.3.29-Win32-VC9-x86.zip"
How?: Thread Safe
URL Download: h*ttp://windows.php.net/download#php-5.6 (without *)
3º Stop Apache
4º Delete all contents in the folder "..\AppServ\php5"
5º Copy the zip contents to "..\AppServ\php5"
6º Add line
date.timezone = "America/Buenos_Aires" (This is my zone, find yours in php page)
to the "php.ini" in "c:\Windows\php.ini"
to avoid date error in PHP
7º Start Apache
=============================
IMAGIC(Once PHP 5.3 is installed)
1º Instalññ Image magic 6.7(Not superior, PHP 5.3 doesn't support)
Filename: "ImageMagick-6.7.9-9-Q16-windows-dll.exe"
URL download: http://ftp.icm.edu.pl/packages/ImageMagick/binaries/
2º Download Imagic
Filename: "php_imagick-3.1.2-5.3-ts-vc9-x86.zip"
URL download: http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/
3º In the dir "php5/ext" add the file "php_imagick.dll" from the last zip download(other files doesn't care)
4º Add line
extension=php_imagick.dll
to the "php.ini" in "c:\Windows\php.ini"
5º Restart Apache

ImageMagick supported formats no value

I have installed download and install ImageMagick-6.8.3-7-Q16-x86-dll.exe from the link http://imagemagick.org/script/binary-releases.php#windows and I am using Windows 7 and PHP 5.3.8.
When in install this it got installed correctly in my machine and convert commands works perfectly. On my convert config what shows is here:
But on my phpinfo section I get:
ImageMagick supported formats has no value
I got all the image magick values like this https://www.evernote.com/shard/s297/sh/12397c86-d016-4ca4-9415-fd541daeca39/2fc504bf5ddba5693efd3249402b2b5c.
I don't know why it is getting as no value i have installed the same ImageMagick-6.8.3-7-Q16-x86-dll.exe on php 5.3.8 in my 32 bit windows7 machine . The php_imagick.dll i downloded from other website. I don't know what is the issue i am having in install imagemaagick, if it is the issue with php_imagick.dll version can anybody suggest proper php_imagick version for this configuration?
I have spent several days looking for a solution, and I finally found it with Sysinternals procmon.
I found out apache was looking for dll files like IM_MOD_xxxx.dll in folders c:\windows\system and /bin. Copying the files to one of those folders did the trick to me.
Cood luck.
Not all versions of ImageMagick will work with all versions of php_imagick.dll. The Imagick extension v3.4.* in combination with ImageMagick 7.* gave no support for any image format. When I downgraded to ImageMagick 6.9.* the problem was solved.
On an echo of phpinfo you can see which version of ImageMagick is needed. Search for "Imagick using ImageMagick library version" and "Imagick compiled with ImageMagick version" (which should be equal).
List of binary downloads:
https://www.imagemagick.org/download/binaries/
Or older versions:
http://windows.php.net/downloads/pecl/deps/
Step by step instructions for installing ImageMagick on Windows:
https://stackoverflow.com/a/28872879/2366136
Since its first result on google when looking for solution to this issue I'll add one that worked for me. Source: http://forums.zend.com/viewtopic.php?t=2397#p15226
I was having issues with PHP 5.6, it recognized the extension but no formats were supported. (http://windows.php.net/downloads/pecl/releases/imagick/3.1.2/)
Installing latest version of imagemagick(with dynamic libs) and copying DLL files from imagemagickDir/modules/coders/* and imagemagickDir/modules/filters/* to imagemagick root helped, now imagemagick works properly from when calling php.
Don't forget to give IIS access to imagemagick folder.
EDIT:
When IIS successfully recognized formats, I ran into compatibility issues.
Working combo for PHP 5.6:
http://windows.php.net/downloads/pecl/releases/imagick/3.2.0b2/
http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ImageMagick-6.8.8-9-Q16-x86-dll.exe
Check that
MAGICK_HOME=C:\Program Files (x86)\ImageMagick-6.8.8-Q16\modules\coders
is set.
I had the same problem, and tried everything. You do not need - as I thought - ImageMagick installed on your system to run the Imagick module for PHP. You simply need to make sure you include both the CORE_RL_* dlls as well as the IM_MOD_* dlls in the apache/bin directory, and then also the php_imagick.dll in the php/ext directory.
I'm running PHP 7.0.25 x86 via XAMPP on Windows, and these instructions were incredibly simple and helpful:
https://mlocati.github.io/articles/php-windows-imagick.html
There are a lot of answers out there, as the landscape for this program and PHP have changed over time.
I am so cutting edge as to be using PHP 7.1 at the moment. At first I was copying DLLs all over the place like all of the instructions have you do. Luckily, all that is necessary is the latest PECL package and the corresponding version of Imagick for your system, which was the tricky part. You can't used the latest Imagick (version 7 at the time of writing this) if you want to use the PHP extension, until the extension is upgraded. You have to install a version of Imagick on your system that matches the PHP extension version.
As others have instructed, download the latest PECL package for imagick for your PHP version. Since I'm using the thread-safe x64 version of PHP 7.1, I want the 3.4.3RC1 package, the only one with a DLL for my version of PHP at this time.
Of these files, I only need to copy over php_imagick.dll. Next, head over to http://windows.php.net/downloads/pecl/deps/ and download the latest Imagick for your system which is probably going to be the VC14 one at this point, for which it seems just a matter of installing the corresponding C++ Redistributable package on your system for it to work. Simply unzip the files and add the bin to your path. Again, if you have a newer version of Imagick, you'll want to replace it with this one because this is the one that will work with the php extension.
At this point, you should be able to restart apache and confirm that the imagick extension is enabled in the phpinfo. It should show you the version of Imagick for the PHP extension. Again, if the Imagick on your system in your path is a version that matches what is shown for the PHP extension, then you should see the list of supported formats that it is getting from the DLLs from the version 6 Imagick on your system. You will not need to copy them to apache bin or anywhere else, nor make a MAGICK_HOME folder.
Even after installing imagick & imagemagick correctly, if it is not working, please check your Apache Environment PATH Variable. Most probably if the path variable is not showing your ImageMagick inatallation folder, please add that into windows advanced system settings/environment variables/system variables -> PATH.
Restart WAMP server and check to see the phponfo for Apache Environment PATH Variable.
I searched posts and tried various suggestions - for several hours. I did not attain success until I tried the steps here: https://mlocati.github.io/articles/php-windows-imagick.html (as posted by Codesmith - and I agree the steps are short, easy-to-follow). My need was to install on WAMP.
The page behind this link tells how to determine the correct version to download of Imagick and ImageMagick. Just extract three sets of files to stated directories, make a change in php.ini, and restart WAMP. My code uses only JPEG and PNG formats, so of the format-based DLLs, I moved only those.

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:
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
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)
add extension=php_imagick.dll line in extensions section
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 (Specially if you have previously installed imagemagick in different folder/version)
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! :)
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/
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!
I've never used WAMP but I have found that sometimes installing PHP extensions on Windows I need to ensure that any dll's that the extension relies on is in the Windows system PATH. If there is more than the one dll packaged with the imagemagick extension, try adding the directory that the dll's reside in to the Windows system PATH then REBOOT (to ensure that the web server gets a copy of the NEW environment).
I know this is an old question but i guess this will help someone someday out there....
If you are on WAMPP and have PHP 5.4.x installed , go here http://www.peewit.fr/imagick/
and download appropriate files as instructed. It will work.
Please see this answer already on StackOverflow:
Installing ImageMagick extension with php/windows
I answered this question some time ago. This solves the DLL mismatch error.

Categories