Building PHP on Windows will require three things
A properly set up build environment, including a compiler with the right
SDK's and some binary tools used by the build system
Prebuilt libraries and headers for third party libraries that
PHP uses in the correct location
-
This is the hardest part of the PHP windows build system to set up and will take up a lot of space on your hard drive - you need to have several GB of space free.
Microsoft Visual C++,
PHP officially supports building with Visual C++ 6.0 or with Visual C++ 9 (also known as Visual C++ 2008 just to be confusing). You can use the Express versions as well. MinGW and other compilers are NOT supported or even known to work. For more information and how to get the compiler see the
supported versions
The correct Windows
SDK or Platform
SDK to match your compiler. see this
page for the supported versions
-
get visual studio 2008 (no matter what version - express, pro or others; all should work) and install it
get and install windows sdk 6.1
get a php 5.3 snapshot (do not extract yet!)
create the folder “c:\php-sdk“
-
open the “windows sdk 6.1 shell” (it’s available from the start menu group) and execute the following commands in it:
-
-
-
bin\phpsdk_buildtree.bat php53dev
now extract the snapshot from 3) to C:\php-sdk\php53dev\vc9\x86 with your favourite unpacker (winrar should handle it) so that the following directory gets created: C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
in the same directory (C:\php-sdk\php53dev\vc9\x86) there is a “deps” folder, extract any of your required libraries inside that folder (see
http://wiki.php.net/internals/windows/libs) but make sure their top-level contains /include and /lib (some of them have an extra directory level in there)
run in the windows-sdk-shell:
cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
-
to get an overview of the compiling flags:
configure --help
create your configure command:
configure --disable-all --enable-cli --enable-$remains
(warning: some extensions need libraries, header files and helper apps, see libs, fetch the version you need and extra the archive in the deps directory, ie: c:\php-sdk\php53\vc9\x86\deps)
-
if you want the resulting php to be zipped (comes handy for redist, believe me!), run after this also:
nmake snap
the compiled php is now under C:\php-sdk\php53dev\vc9\x86\php5.3-SNAPSHOTTIME\Release_TS, same as the zip file (if you created it).
cd C:\php-sdk\php53dev\vc9\x86
get the dbase extension code through Subversion
svn co http://svn.php.net/repository/pecl/dbase/trunk pecl/dbase
-
-
executing
configure --help
should now contain a dbase option
configure --enable-cli --enable-dbase
-
test the binary with a
php -m
command, to make sure dbase exists