PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net


 

Build your own PHP on Windows

Requirements

  • Visual Studio, see this page for the supported versions
  • Windows SDK or Platform SDK, see this page for the supported versions

Setup

  • The set of tools required by the configure scripts
c:\Users\Pierre\> set PATH=%PATH%;c:\Users\pierre\Documents\php-sdk\bin
c:\Users\Pierre\> set BISON_SIMPLE=C:\Users\pierre\Documents\php-sdk\bin\bison.simple

The BISON_SIMPLE is important for the first time nmake is run. If this variable is not set (or if you don't have any /usr/local…), the following error will be raised:

        bison.exe --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y
C:\Users\pierre\Documents\php-sdk\bin\bison.exe: /usr/local/share/bison.simple: No such file or directory
NMAKE : fatal error U1077: 'C:\Users\pierre\Documents\php-sdk\bin\bison.exe' : return code '0x2'
Stop.

Configuration

  • Extract PHP source code in the same directory you have extracted the binary tools and libraries. This is important for the build system to be able to find the libraries.
  • You may now have something like the following:
    • bin
    • includes
    • lib
    • phpx.x
  • Open cmd.exe using the shortcut installed by Visual Studio in the Start menu (in Visual C++ > Visual Studio Tools). This shortcut sets up some environment variables needed by the build system.
  • Go to the php directory
  • Type the following commands:
    set PATH=C:\path where you extracted the binary tools\bin;%PATH%
    # also run the commands from the previous section
    buildconf
    configure
    nmake

Visual Studio Express

Building with VS Express will not work as it will not find the WinResrc.h file.

I found that copying C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\WinResrc.h to winres.h allows PHP to build with VS Express.

 
internals/windows/stepbystepbuild.txt · Last modified: 2008/08/26 16:39 by ronabop
 
Atom | show source | credits | stats | sitemap | contact | advertising | mirror sites