logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: [Windows] Building PHP under windows
Author
frozen



Joined: 14 Sep 2006
Posts: 4
Location: Canada

PostPosted: Thu 14 Sep '06 23:54    Post subject: [Windows] Building PHP under windows Reply with quote

In theory, if Apache runs better compiled with Visual C 8 then wouldn't PHP also? I am not even sure what the PHP binaries on php.net are compiled with but I would like to compile PHP 5.1.6 with Visual C 8. Where do I start?!
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 15 Sep '06 7:26    Post subject: Reply with quote

Well, I haven't given it much of a test - but these steps were enough to get PHP 5.1.6 built.

It starts up OK in Apache 2.2.3 and I've run a few simple PHP pages without problems.

I hope this helps you get started.
-tom-

You need:
Visual C++ 2005 Express Edition http://msdn.microsoft.com/vstudio/express/visualc/download/
Windows Server 2003 R2 Platform SDK http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB
.NET Framework SDK Version 1.1 http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D
Windows Script Host http://www.microsoft.com/downloads/details.aspx?FamilyID=C717D943-7E4B-4622-86EB-95A22B832CAA

Download php-5.1.6.tar.gz from: http://us3.php.net/get/php-5.1.6.tar.gz/from/a/mirror
Untar this into your working directory

Download http://www.php.net/extra/bindlib_w32.zip
Extract this into (create new directory) bindlib_w32 in your working directory

Download http://www.php.net/extra/win32build.zip
Unzip into your working directory

You should have three new directories named: php-5.1.6, bindlib_w32, and win32build

Check that you have (at least) these directories in your PATH, INCLUDE, and LIB environment variables:
PATH
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
C:\Program Files\Microsoft Visual Studio 8\VC\BIN
C:\Program Files\Microsoft Visual Studio 8\Common7\Tools
C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages
INCLUDE
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\mfc
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE
C:\Program Files\Microsoft.NET\SDK\v1.1\include
LIB
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib
C:\Program Files\Microsoft Visual Studio 8\VC\LIB
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib
C:\Program Files\Microsoft.NET\SDK\v1.1\Lib

Make sure there is a copy of zip.exe in your PATH
(You can get it at http://www.info-zip.org/ if you don't have it)

In Visual Studio 2005 Express - open bindlib_w32\bindlib.dsw
Choose "Yes to all" to convert the project to VS8 format
Select "Build" - "Configuration Manager..." - choose "Release"
Select "Build" - "Build Solution"
The last line in the Output window should say "========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped =========="

Copy bindlib_w32\Release\resolv.lib to win32build\lib\ (replacing the previous resolv.lib)

Copy your installed Apache 2.2.3 \include and \lib directories to win32build\Apache2\include and win32build\Apache2\lib
Rename win32build\Apache2\lib\libapr-1.lib to libapr.lib
Rename win32build\Apache2\lib\libaprutil-1.lib to libaprutil.lib

In the php-5.1.6 directory
Quote:
buildconf.bat

cscript /nologo configure.js --help

cscript /nologo configure.js --enable-apache2handler --without-libxml --without-iconv --without-gd

It seems to be OK if you are missing the programs "lemon" and "re2c"
There should not be any other instances of "<not found>" in the output.
If there are, you will either need to go find the missing files or disable that extension.
I chose to disable libxml, iconv, and gd because I didn't have libjpeg.lib, libxml2.lib, and iconv.h.
I didn't bother to go find them.
Quote:
nmake

nmake dist
Back to top


Reply to topic   Topic: [Windows] Building PHP under windows View previous topic :: View next topic
Post new topic   Forum Index -> Other Software