I'm using the current version of XAMPP (Version 5.6.14) with Apache/2.4.17 (Win32) and PHP/5.6.16 on Windows 8.1
To install ImageMagick locally, I created this directory off the root:
c:\ImageMagick
Then, from here:
http://windows.php.net/downloads/pecl/deps/
...I downloaded the X86 thread-safe version that would match the DLL (which you have to obtain separately, which mystifies me). The version I downloaded was:
ImageMagick-6.9.1-2-vc11-x86.zip
I unzipped it to C:\ImageMagick and then moved the contents of its "bin" subfolder to C:\ImageMagick, so that everything is in the root of that directory.
I then added C:\ImageMagick to my PATH and verified that it worked by first exectuting
Code: Select all
convert
Then, following the advice culled from other online postings about how to do this, I copied the CORE_RL_*.DLL files and the IM_MOD_RL*.DLL files from C:\ImageMagick to c:\xampp\apache\bin
I then added this system environment variable:
Code: Select all
MAGICK_HOME=c:\imagemagick
http://windows.php.net/downloads/pecl/r ... /3.3.0rc2/
...and download:
php_imagick-3.3.0rc2-5.6-ts-vc11-x86.zip
...I then unzipped it to a dedicated "junk" directory and copied the php_imagemagick.dll file it contained to c:\xampp\php\ext
I then edited the php.ini file in c:\xampp\php to include this directive:
Code: Select all
extension=php_imagemagick.dll
I started XAMPP and checked the PHP_ERROR_LOG, and found no errors. I then ran PhpInfo.php and confirmed that ImageMagick was loaded; here is the screen shot:
So, that would seem to indicate that XAMPP recognizes ImageMagick, and that is has been installed correctly and with no errors.
Now for the meat of the issue: when the following script is run from my live server (DreamHost), it successfully converts the X.JPG image as indicated (notice the redundant check for the imagick extension at the beginning):
Code: Select all
<?php
if (!extension_loaded('imagick')) {
echo "imagick not installed...";
} else {
echo "imagick installed...";
}
echo "Start...";
$uploaded_filename = "x.jpg";
$im = new Imagick();
echo "Created object...";
$im->readImage("x.jpg");
echo "Read JPG...";
$im->resizeImage(528, 0, Imagick::FILTER_LANCZOS2SHARP, 1);
$im->stripImage();
$im->writeImage("x_lg.jpg");
$im->clear();
$im->destroy();
echo "Done."
?>
Any suggestion as to what I may have omitted in my installation?