How to install ImageMagick with Wampserver 3.0.0 64? - php

I lost a day trying to figure this out, at various times getting "no decode delegate for this image format" and "The specified module could not be found" errors. The information I could find on these problems was dated in terms of version numbers, and many included instructions like overwriting the ImageMagick-installed dlls from the PECL distribution or copying dlls into windows/system32; two things I didn't want to do.
Environment: Windows 10
Wampserver: 3.0.0, Apache/2.4.17 (Win64) PHP/5.6.16

Downloaded and installed latest ImageMagick:
ImageMagick-7.0.2-0-Q16-x64-dll.exe
Downloaded php_imagick-3.4.3rc1-5.6-ts-vc11-x64 from http://windows.php.net/downloads/pecl/releases/imagick/3.4.3rc1/
Unpacked php_imagick.dll into [wampserver directory]\bin\php\php5.6.16\ext
Added extension=php_imagick.dll to
[wampserver directory]\bin\apache\apache2.4.17\bin\php.ini
Got "no decode delegate for this image format" error, but at least imagick showed up in phpinfo() where I could see that php_imagick.dll was compiled with ImageMagick 6.9.3-7 Q16 x64. There was no obvious way to know this beforehand.
Downloaded ImageMagick-6.9.3-7-Q16-x64-dll.exe from http://ftp.icm.edu.pl/packages/ImageMagick/binaries/ (ImageMagick has removed this package from their site).
Uninstalled ImageMagick-7.0.2-0-Q16-x64,
installed ImageMagick-6.9.3-7-Q16-x64 to c:\ImageMagick,
added c:\ImageMagick to PATH (in front, to avoid collision with windows convert.exe).
Verified everything ok with:
$image = new Imagick();
$image->readImage([path to my jpeg]);
$wm = new Imagick();
$wm->readImage([path to my watermark png]);
$image->compositeImage($wm, imagick::COMPOSITE_OVER, 5, 5);
header("Content-Type: image/jpeg");
echo $image;

I have tried a lot of things. What has done the trick was to add at the end of active php.ini lines :
[ImageMagick]
extension="C:\WampDeveloper\Components\Php\ext\php_imagick\php_imagick.dll"
;imagick.locale_fix=0
;imagick.progress_monitor=0
Credit :
http://www.devside.net/wamp-server/installing-and-using-imagemagick-with-imagick-php-extension-php_imagick-dll-on-wamp

Related

XAMPP x64 and Imagick in Windows 10 doesn't work

I'm trying to install imagick on XAMPP x64 with PHP x64 architecture, I followed those steps:
1 - Download and install ImageMagick for Windows, I installed this version: ImageMagick-7.0.9-9-Q16-x64-dll.exe
2 - Download Imagick for PHP, I downloaded this version php_imagick-3.4.4-7.2-ts-vc15-x64, added the php_imagick.dll in xampp/php/ext folder and enabled the extension in php.ini.
3 - Download required Imagick binaries, I downloaded this bin ImageMagick-7.0.7-11-vc15-x64 and added them in xampp/apache/bin folder.
4 - Download Ghostscript, I installed this version gs950w64.
Then I restart XAMPP with all related services. In the phpinfo I see the imagick extension and it works but if I run this code I get an ERR_CONNECTION_RESET error.
$im = new Imagick();
$im->pingImage(realpath('sample.pdf'));
echo $im->getNumberImages();
Here the phpinfo:
What's the problem?
Thanks
UPDATE:
If I run "composer show --platform" I get this warning "PHP Warning: Version warning: Imagick was compiled against ImageMagick version 1799 but version 1801 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0". I don't know if it is relevant.
The problem appears only with PDF files, if I run the same code with a jpg image it works correctly
a bit late, but after a hard day of trying to get Windows + PHP + imagick + Ghostview running I want to share my solution.
Using PHP 7.2 (Tread Safe, WIN 32, CGI/FastCGI) I installed the matching PHP-imagick-version without problems (php_imagick-3.4.4-7.2-ts-vc15-x86.zip)
(Tip for CGI/FastCGI: php_imagick.dll as described into the PHP-ext-directory, but the other 150 imagick-dlls to cgi-bin-folder)
Afterwards I installed the actual win32-version (gs952w32.exe) and got lots of "Internal Server Error" and the apache-error-log growed...:-(
Solution:
Moving backwards in older gs-releases (https://github.com/ArtifexSoftware/ghostpdl-downloads/releases) i succeeded to get a running installation with 9.25 (gs925w32.exe).
BTW:
On my private linux-machine the same installation of PHP, Imagick and Ghostview needed only a few minutes...

Imagick delegates installation on WAMP

I would like to know how to download the correct Imagemagick decode delegates from http://www.imagemagick.org/download/delegates/, as well what to do with them afterwards.
I'm using:
Imagick 3.4.3RC1, 6.9.3-7 Q16 x64 2016-03-27
PHP 5.6.25
WAMP 3.0.0.25 on Windows 7
I've been looking on Imagick and Stackoverflow threads, but the ones I found were mostly concerning errors with the delegates after they had them, and none of them used WAMP. Any help would be appreciated
In the past this has worked by installing ImageMagick and then downloading a compatible imagick PHP extension.
But currently there seems to be a temporary "Catch 22" situation with ImageMagick and imagick.
imagick versions need to be compiled against a specific version of ImageMagick and currently that has not been done for imagick against the new ImageMagick 7 although I am informed by #danack that imagick is ready to be compiled but nobody has done so yet, or at least they have not shared the binary.
Unfortunately ImageMagick do not retain older versions of their install i.e. ImageMagick 6.? so if you dont already have a version of the installer the only availaible one is ImageMagick 7
The Catch 22
Therefore the only versions of imagick available will only work with ImageMagick 6 and you cannot download ImageMagick 6 as the ImageMagick people do not retain old version of their installer.
The work around
However, if you only want ImageMagick to work within a PHP/Apache environment this proceedure works.
The versions of the following must match your WAMPServer, so if you installed WAMPServer 32bit use the 32bit versions of ImageMagick and Imagick, if you use WAMPServer 64bit, use the 64bit versions of ImageMagick and Imagick.
The VC14 versions should work with WAMPServers Apache 2.4.x versions
Download ImageMagick-6.9.3-7-vc14-x86.zip (32bit)
or ImageMagick-6.9.3-7-vc14-x64.zip (64bit)
from http://windows.php.net/downloads/pecl/deps/ depending upon which WAMPServer version you are using i.e. 32bit or 64bit
Download php_imagick-3.4.3-5.6-ts-vc11-x86.zip (32bit)
or php_imagick-3.4.3-5.6-ts-vc11-x64.zip (64bit)
from http://windows.php.net/downloads/pecl/releases/imagick/3.4.3/ depending upon which WAMPServer version you are using i.e. 32bit or 64bit
Create a folder to hold ImageMagick, I used wamp\imagemagick
Unzip whichever of the ImageMagick's you downloaded i.e.
ImageMagick-6.9.3-7-vc14-x86.zip or ImageMagick-6.9.3-7-vc14-x64.zip into the wamp\imagemagick folder
Unzip whichever of the imagick version you downloaded php_imagick-3.4.3-5.6-ts-vc11-x86.zip (32bit) or php_imagick-3.4.3-5.6-ts-vc11-x64.zip (64bit) into a temp folder and copy the php_imagick.dll from the temp folder to your wamp\bin\php\php5.6.25\ext folder
Edit your 'php.inifile to add the extension. Use the wampmanager menus so you edit the correct file
(left click) wampmanager->PHP->php.ini
Add the lineextension=php_imagick.dllinto the section ofphp.inithat contains the otherextension` parameters.
Add the folder to your windows PATH using
Control Panel -> System -> Advanced System Setting
Select the Advanced Tab
Click the Environment Variables Button
Add C:\wamp\imagick; to the PATH variable in the System Variables section
[I dont like adding anything to the PATH for WAMPServer, but I cannot think of a better solution for now and as this way will work for multiple versions of PHP it is not actually so bad]
Start WAMPServer, or restart Apache. It may be necessary to reboot windows, it was for me, but maybe that was because I tried a number of things before I got to this solution.
Check with phpinfo() you should see

PHP Imagick UwAmp installation not working

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.

Installing ImageMagick on WAMP (Win7) : Class not found

I've tried just about everything I've been able to find and so far nothing seems to work.
Regardless of what I install, php always returns "Fatal error: Class 'Imagick' not found."
My system is:
Win7, 64bit
Apache 2.2.21
PHP 5.3.10
PHP Extension Build: API20090626,TS,VC9
I've installed various versions of ImageMagick (6.6.7, 6.7.1, and 6.8.5, both x86 and x64), and used dll's (VC6 and VC9) from http://chernoivan.ru/tools/imagemagick-dlls.html, http://www.sk89q.com/2010/03/vc6-windows-binaries-for-imagick-2-3-0/, and http://valokuva.org/?m=201211.
WAMP shows the extension as being activated (I added extension=php_imagick.dll to my php.ini file)
phpinfo() though never shows anything specific to imagick besides some path variables and the script itself:
<?php
header('Content-type: image/jpeg');
$image = new Imagick('image.jpg');
// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);
echo $image;
?>
always says class not found.
What could the problem at this point be?
Discovered the problem.
ImageMagick (at least from what I can tell) will not work on a x64 installation of php.
Fix was to install a different version of WAMP with a x86 build of php.
Used the dll found here: http://www.peewit.fr/imagick/
With ImageMagick-6.8.1-8-Q16-x64-dll.exe found here: http://image_magick.veidrodis.com/image_magick/binaries/

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.

Categories