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

search for in the

Installation of extensions on Windows> <Xitami on Microsoft Windows
[edit] Last updated: Fri, 25 May 2012

view this page in

Building from source

This chapter teaches how to compile PHP from sources on windows, using Microsoft's tools. To compile PHP with cygwin, please refer to Installation auf Unix-Systemen.

See the Wiki documentation at: » http://wiki.php.net/internals/windows/stepbystepbuild



add a note add a note User Contributed Notes Building from source
nospam at mail dot net 17-Mar-2012 04:35
Building with VC9 on WinXP throws a lot of liker errors. I can't seem to find a solution to this. The errors are acknowledged here  - <a href="https://wiki.php.net/internals/windows/todo">https://wiki.php.net/internals/windows/todo</a> but there is no solution, yet!
buda 15-Nov-2011 07:10
Using --enable-snapshot-build when setting the configure command requires you to also set --disable-static-analyze (Win7 64Bit, VC9 Express, SDK 6.1) for otherwise you will run into a fatal compiler error "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Include\tchar.h(1659) : fa
tal error C1001: Interner Compilerfehler.
(Compilerdatei "msc1ast.cpp", Zeile 1411)"
(see also https://bugs.php.net/bug.php?id=55779)
thoer81 at gmail dot com 06-Mar-2010 07:52
If you're getting an error that says "We really need that arpa\nameser.h file - it is part of the win32build package", make sure you download a bindlib-something archive which is not found in VC9/x86 folder itself, but it is present in the VC9/x86/archive.
Joel Low 26-Feb-2010 07:12
To build everything in the distribution, pass --enable-snapshot-build to configure.js. In addition, you may like to use "snap" as the nmake target. If you intend to build the PHP Windows Installer, WiX source files can be obtained from http://svn.php.net/repository/php/win-installer/.
michal dot kocarek at brainbox dot cz 17-Aug-2009 05:10
PHP extensions can be compiled statically or shared.

- Shared compilation creates a well-known php_*.dll file.
- Static compilation puts the extension directly into PHP (therefore it does not need to be loaded and cannot be unloaded)

You can switch whether to compile given extension statically or as library by adding =static or =shared to the extension in configure.js command during the compilation.

configure --enable-http=static --with-openssl=shared
// http extension will be included in PHP
// openssl extension will be compiled as separate DLL
Bas van Beek 12-Mar-2009 12:50
If trying to compile the code (Windows XP, SDK v6.1) and you get the following types of errors:

c:\phpdev\php-5.2.9\main\php_network.h(128) : warning C4005: 'POLLIN' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1495) :
see previous definition of 'POLLIN'
c:\phpdev\php-5.2.9\main\php_network.h(129) : warning C4005: 'POLLPRI' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1496) :
see previous definition of 'POLLPRI'
c:\phpdev\php-5.2.9\main\php_network.h(130) : warning C4005: 'POLLOUT' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1499) :
see previous definition of 'POLLOUT'
c:\phpdev\php-5.2.9\main\php_network.h(131) : warning C4005: 'POLLERR' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1502) :
see previous definition of 'POLLERR'
c:\phpdev\php-5.2.9\main\php_network.h(132) : warning C4005: 'POLLHUP' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1503) :
see previous definition of 'POLLHUP'
c:\phpdev\php-5.2.9\main\php_network.h(133) : warning C4005: 'POLLNVAL' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.1\include\winsock2.h(1504) :
see previous definition of 'POLLNVAL'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.exe"' : return code '0x2'
Stop.

You can alter the Makefile and add the following switch to CFLAGS:

/D _WIN32_WINNT
php at tattodecastro dot com 06-Dec-2007 09:14
If you are getting the following error message:
Input Error: There is no script engine for file extension ".js"
with Visual Studio 2005 Command Prompt or similar, try to add  "/e:jscript" to the command line.

Something like:
cscript /nologo /e:jscript win32/build/buildconf.js

It worked for me, I hope it helps.
giunta dot gaetano at gmail dot com 27-Jun-2007 12:43
A detailed tutorial for building php 5 using VC++ 2005 express edition (ie. the free version) is available here: http://elizabethmariesmith.com/2006/11/15/

It can be a huge time saver if you do not have a complete VC6 toolchain already setup
axel at kollmorgen dot net 27-May-2007 12:13
>>Compiling using Visual Studio .NET will create binaries dependent of msvcp71.dll
>
> Only if you compile with the wrong runtime library.

if this is so easy, please tell us how you managed to *not* create dependencies on msvcp71.dll/msvcr80/... using Visual C++ .NET 2000/2003/2005. thanks!
09-Dec-2006 11:09
>> Compiling using Visual Studio .NET will create binaries dependent of msvcp71.dll

Only if you compile with the wrong runtime library.
zbowden at vt dot edu 12-May-2006 01:12
When running "cscript /nologo configure.js" 5.x on Windows
2000 or XP, if you get the following error:
Microsoft JScript runtime error: Object doesn't support this
property or method

You need to have at least version 5.6 of WSH.
This is necessary because configure.js will use the .Exec()
method of the WScript.Shell.
This evidently didn't exist until 5.6?
 
You can download WSH 5.6 here:
http://www.microsoft.com/downloads/details.aspx?
FamilyID=c717d943-7e4b-4622-86eb-95a22b832caa&DisplayLang=en
C-Reaction.net - Software Development 02-Apr-2006 06:16
Don't forget to setup Environment variable:
BISON_SIMPLE="C:\\work\\win32build\\bin\\bison.simple"

or this can cause error:
c:/usr/local/lib/bison.simple: No such file or directory

Alexey Furmanov.
25-Jan-2005 09:30
Compiling using Visual Studio .NET will create binaries dependent of msvcp71.dll which has three repercussions:
1. This dll will need to be distributed.
2. The binaries are not currently compatible with the Zend optimiser (not sure why it should make a difference but it does).
3. Binaries are larger!

 
show source | credits | stats | sitemap | contact | advertising | mirror sites