Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
754 views
in Technique[技术] by (71.8m points)

iis - Installing ImageMagick extension with php/windows

Running PHP Version 5.2.5 on Windows Server 2003 with IIS.

Have virtually an identical server where we were able to install ImageMagick with no issues. It's running exactly the same version of php. Used the following steps to install, but it just won't seem to work on this server. ImageMagick itself is installed but php won't load the extension.

We've spent hours trying to get the extension installed. It just won't show up in phpinfo().

INSTALL STEPS TAKEN

To install IMagick on Windows XP (PHP 5.2.x)

  1. download and install ImageMagick-6.5.8-7 Q16-windows-dll.exe http://www.imagemagick.org/download/binaries/ImageMagick-6.5.8-7-Q16-windows-dll.exe

  2. download php_imagick_dyn-Q16.dll from http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/

    copy DLL to [PHP]/extension dir and rename it to php_imagick.dll

  3. You have to edit your php.ini file and add the new extension:

    extension=php_imagick.dll
    
  4. Save php.ini and restart Apache server. (If necessary, restart Windows)

  5. phpinfo() should show imagick enabled.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Found very useful tha answer given by user Buttercup, also if he could be more clear.

My scenario was a Windows 2012 R2 x64, PHP 5.5.19 x64 and need to install ImageImagick with PHP support. Following points here below I was able to install ImageImagick 6.9.0 x64 and PHP_Imagick.dll 3.1.2 (both are currently the latest stable versions).

Please note I downloaded all components (PHP, ImageImagick and PHP_Imagick) in NTS and x64 modes: not in TS and/or x86 modes. I don't know if this apply in your own case.

The point it wasn't clear for me reading the Buttercup (as for user RhoVisions) was his comment: "Overwrite the DLLs found from ImageMagick 6.8.8 Windows version with the PHP version".

So, this is what I've done (based on Buttercup solution, who I have to say again and again thank you very much!):

  1. download latest ImageMagick EXE installer from Link In my case I downloaded the first file available as HTTP download labeled "Win64 dynamic at 16 bits-per-pixel" (filename: ImageMagick-6.9.0-0-Q16-x64-dll.exe)

  2. Run the installer just downloaded. I installed it in a simple path like C:ImageMagick6.9.0 (but I don't think it is so important to move it away from Program Files). Also, I didn't change any other parameter from their defaults during installing.

  3. download latest PHP_Imagick DLL file from PECL website at: http://pecl.php.net/package/imagick I choosed a stable (not Beta or RC) version, in my case 3.1.2, clicking on the "Windows logo"+"DLL" label. In my case it was linked to ht tp://pecl.php.net/package/imagick/3.1.2/windows . On the page it will open you'll find a table: you have to choose your file depending on: a) number of version of PHP you have (in my case there were available DLLs for PHP 5.3, 5.4, 5.5, 5.6) b) x64 or x86 version of PHP you have c) NTS or TS version of PHP you have My case is was PHP 5.5.x, x64, NTS: so I downloaded the one labeled "5.5 Non Thread Safe (NTS) x64" (file name: php_imagick-3.1.2-5.5-nts-vc11-x64.zip)

  4. Unzip the php_imagick ZIP and: a) copy php_imagick.dll file into the EXT folder of your PHP installation b) copy and replace ALL the CORE_RL_.dll from the folder you just unzipped into the folder you choosed at point #2. Obviously, please backup replaced files. In my case I copied 8 CORE_RL_.dll files from unzipped folder to C:ImageMagick6.9.0. I leaved into C:ImageMagick6.9.0 the others CORE_RL_*.dll not overwritten.

  5. Edit and save your PHP.ini file in order to add this simple row: extension=php_imagick.dll

  6. Reboot your server (unfortunally I didn't find any good alternative of a reboot: also a IISRESET from admin command-prompt didn't work).

  7. When reboot finished, visit remotely by browser your phpinfo.php file in order to verify that Imagick module was ok. In my case it was.

Hope this could help, out there!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...