english version is below!

php auf windows kompilieren geht einigermaßen leicht, wenn man weiß wie:

  1. visual studio 2008 (egal welche version – express, pro oder so; es gehen alle) besorgen und installieren
  2. windows sdk 6.1 besorgen
  3. einen php 5.3 snapshot herunterladen (noch nicht entpacken!)
  4. einen ordner “c:\php-sdk” erstellen
  5. in diesen ordner dieses archiv entpacken. jetzt sollte es nen ordner “bin” und nen ordner “script” geben
  6. die “windows sdk 6.1 shell” öffnen, erreichbar über’s startmenü
  7. setenv /x86 /xp /release
  8. cd c:\php-sdk\
  9. bin\phpsdk_setvars.bat
  10. bin\phpsdk_buildtree.bat php53dev
  11. jetzt den snapshot in C:\php-sdk\php53dev\vc9\x86 entpacken, und zwar so, dass folgender ordner rauskommt: C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
  12. in der windows-sdk-shell:
  13. cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
  14. buildconf
  15. jetzt configure --help, um eine übersicht über die optionen zu erhalten
  16. configure --disable-all --enable-cli --enable-$rest (achtung: einige extensions benötigen libraries und anderen kram, keine ahnung wie das geht!)
  17. nmake
  18. falls man alles benötigte gezippt haben will: nmake snap
  19. das kompilierte php findet sich unter C:\php-sdk\php53dev\vc9\x86\php5.3-200812271930\Release_TS, ebenso das zip, falls erstellt.

In English:

it’s easy to compile php on windows, at least if you know how:

  1. get visual studio 2008 (no matter what version – express, pro or others; all should work) and install it
  2. get and install windows sdk 6.1
  3. get a php 5.3 snapshot (do not extract yet!)
  4. create the folder “c:\php-sdk
  5. unpack this archive into this directory, there should be one sub-directory called “bin” and one called “script
  6. open the “windows sdk 6.1 shell” (it’s available from the start menu group) and execute the following commands in it:
  7. setenv /x86 /xp /release
  8. cd c:\php-sdk\
  9. bin\phpsdk_setvars.bat
  10. bin\phpsdk_buildtree.bat php53dev
  11. 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
  12. run in the windows-sdk-shell:
  13. cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
  14. buildconf
  15. now configure --help, to get an overview of the compiling flags
  16. configure --disable-all --enable-cli --enable-$remains (warning: some extensions need libraries, header files and helper apps, i have NO idea how to get these working!)
  17. nmake
  18. if you want the resulting php to be zipped (comes handy for redist, believe me!), run after this also “nmake snap"
  19. 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).

credits go to pierre from freenode channel #php-dev-win for hours of support for this. thanks man.




hard.blog is Digg proof thanks to caching by WP Super Cache