Keep Server Online|
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Apache Lounge is not sponsored.
Your donations will help to keep this site alive and well, and continuing building binaries.
BitNami WAMP Stack
Contains ApacheLounge build
Joined: 04 Jan 2006
|Posted: Tue 18 Mar '08 6:04 Post subject: Building PHP 5.2.5 with imagick 2.1.1 using VCE 2005
|I added this to this section via admin request.
Ok, so now I have VCE 2005 up and running I gave a shot at compiling imagick 2.1.1 stable release from the PECL site which turned out to be tougher than it looked.
The install file says to simply add the imagick folder from the source to the ext folder of the php source and build --with-imagick to create the php_imagick.dll. Well kinda, but not quite.
First you have to install ImageMagick, then copy the contents of its include and lib folders to the right place in the php_build folders. Here's how I accomplished it:
1. Download Microsoft Visual Studio 2005 Express, install, update and register.
2. Download Microsoft Platform SDK for Windows 2003 R2, install and setup via this link http://msdn2.microsoft.com/en-us/library/ms235626(VS.80).aspx
3. Download PHP Source and extract into a temp folder using 7Zip or similar utility that supports tar, bz2, etc.
4. Download bindlib_w32 and extract into a temp folder and build resolv.lib.
5. Download ImageMagick, install and test to make sure it works.
6. Download zip.zip and extract into a temp folder.
7. Download imagick 2.1.1 and extract into a temp folder.
8. Create a work folder to begin the project, i.e. x:\work and place the php-5.2.5, php_build, template and bindlib_w32 folders into it.
9. Add the x:\work\php_build\bin to PATH, x:\work\php_build\include to INCLUDE and x:\work\php_build\lib to LIB Environment Variables under Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables
10. Rename the following:
x:\work\php_build\include\magick -> x:\work\php_build\include\magick.old,
x:\work\php_build\include\Magick++ -> x:\work\php_build\include\Magick++.old,
x:\work\php_build\include\imagemagick\magick -> x:\work\php_build\include\imagemagick\magick.old,
x:\work\php_build\include\imagemagick\wand -> x:\work\php_build\include\imagemagick\wand.old,
x:\work\php_build\lib\CORE_RL_magick_.lib -> x:\work\php_build\lib\CORE_RL_magick_.lib.old,
x:\work\php_build\lib\CORE_RL_Magick++_.lib -> x:\work\php_build\lib\CORE_RL_Magick++_.lib.old,
x:\work\php_build\lib\X11.lib -> x:\work\php_build\lib\X11.lib.old,
x:\work\php_build\lib\resolv.lib -> x:\work\php_build\lib\resolv.lib.old
11. Copy the following from your ImageMagick installation folder, i.e. C:\Program Files\ImageMagick to the x\work\php_build folder(s) below:
C:\Program Files\ImageMagick\include\wand\*.* -> x\work\php_build\include\imagemagick\wand,
C:\Program Files\ImageMagick\include\magick\*.* -> x\work\php_build\include\imagemagick\magick,
C:\Program Files\ImageMagick\include\Magick++\*.* -> x\work\php_build\include\imagemagick\Magick++,
C:\Program Files\ImageMagick\lib\*.* -> x\work\php_build\lib,
12. Copy resolv.lib from x\work\bindlib_w32\Release\resolv.lib -> x\work\php_build\lib\resolv.lib
13. Copy the imagick-2.1.1 folder from your temp folder to x:\work\php-5.2.5\ext and rename it to x:\work\php-5.2.5\ext\imagick
14. Open Start -> All Programs -> Visual C++ 2005 Express Edition -> Visual Studio Tools -> Visual Studio 2005 Command Prompt
15. Change to your PHP Source folder, i.e. x:\work\php-5.2.5
16. Enter the following commands:
cscript /nologo configure.js --enable-snapshot-build
This should create a working copy of PHP with the needed php_imagick.dll under the x:\work\php-5.2.5\Release_TS\php-5.2.5\ext folder. I hope this saves a few people the day or two it took me to figure out.