Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ImageMagick to use with PHP on Windows 7 (3)

There are other threads about how to install Imagick on Windows 7 but no help for me so far. (Maybe problems have came up with more recent versions)

I have followed these steps to install:

  1. Download and install ImageMagick

http://www.imagemagick.org/download/binaries/ImageMagick-6.8.8-1-Q16-x86-dll.exe

  1. Download php_imagick.dll and copy to extension dir (c:\xampp\php\ext)

http://www.peewit.fr/imagick/php55/vc11/x86/ts/php_imagick.dll

  1. Edit php.ini file and add new extension (c:\xampp\php\php.ini)

extension=php_imagick.dll

  1. Save ini file and restart Apache (if necessary, restart Windows)

  2. Start Apache and run test

When I start Apache i get a pop up box that displays:

The program can't start because php5.dll is missing from your computer. Try reinstalling the program to fix this problem.

Then directly after this comes another:

PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_imagick.dll' - The specified module could not be found.

According to funtioneer I suspect some kind of compilation error.

Now I have PHP Version 5.5.6 (xampp 1.8.3) with compiler MSVC11 which is the same as for the php_imagick.dll file.

Is download ImageMagick from source and compile it on my own the right way to go? (have never compiled in Windows before)

like image 679
embe Avatar asked Jan 07 '14 16:01

embe


People also ask

How do I add imagick to PHP?

Navigate to Home - Software - Module Installers, then click on the Manage button next to PHP Pecl. In the next screen, select the required PHP version, then click Apply. You can now enter “imagick” in the Install a PHP Pecl field, and click the Install Now button.

How do I know if PHP imagick is installed?

echo "Version return code is $rcode <br>"; //Print the return code: 0 if OK, nonzero if error. echo alist($out); //Print the output of "convert -version" echo '<br>'; echo '<b>This should test for ImageMagick version 5.


2 Answers

Instead of using the latest version I tried downloading ImageMagick-6.7.7-5-Q16-windows-dll from here. That one actually worked with the php_imagick.dll (Imagick for PHP 5.5.x) from http://www.peewit.fr/imagick/.

This is not the latest version but it worked. (even without restarting the computer)

like image 82
embe Avatar answered Oct 07 '22 23:10

embe


Here what finally worked for me after trying almost every possible solution posted in internet:

Environment:

OS: Windows Server 2008 R2 (64bit)

IIS: 7.5

PHP: 5.5.11 (x86)

PHP.ini: VC11, x86

Download and install ImageMagick

ImageMagick-6.8.9-1-Q16-x86-dll.exe

Download corresponding .zip from Anatol suggested sources (kudos to Anatol!)

ImageMagick-6.8.9-1-vc11-x86:

Extract to a temporary folder and copy the contents of the "bin" folder inside the Imagemagick installation (c:\imagemagick) in my case overwriting files.

Download .dll and put it in the php extensions folder (I used this one)

Imagick for PHP 5.5.x Non Thread Safe from: http://www.peewit.fr/imagick/

Add the extension to php.ini with:

extension=php_imagick.dll

Save php.ini and restart IIS

Finally Image Magick information was displayed in a phpinfo(); call.

It is incredible to think to solve this problem needed to download files from 3 different locations.

Hope it helps.

like image 20
lithiumlab Avatar answered Oct 07 '22 22:10

lithiumlab