Before getting started, it is worthwhile answering the question: "Why is building on Windows so hard?" Two reasons come to
mind:
在開始前,我們來回答一個問題:“為什麼在 Windows 下編譯 php 如此困難?“,2個注意的原因是:
Windows does not (yet) enjoy a large community of developers who are willing to freely share their source. As a direct
result, the necessary investment in infrastructure required to support such development hasnt been made. By and large, what
is available has been made possible by the porting of necessary utilities from Unix. Dont be surprised if some of this
heritage shows through from time to time.
Windows 不是一個大量願意免費共用他們代碼的開發團體。直接導致支援這些開發的基礎投資沒有建立,而Unix 可能已經建立了。
Pretty much all of the instructions that follow are of the "set and forget" variety. So sit back and try follow the
instructions below as faithfully as you can.
下面的大多數好東西是"set and forget".所以請儘可能嚴格按照下面的步驟進行。
Preparations
Before you get started, you have a lot to download....
準備:
在開始前,你需要下載許多東西!!
For starters, get the Cygwin toolkit from the closest Cygnus mirror site. What you are looking for is cygwin.exe file. This
will provide you most of the popular GNU utilities used by the build process.
http://sources.redhat.com/cygwin/download.html
開始,從最近的 Cygnus 的鏡像網站擷取 Cygwin 工具箱。你要找的是 cygwin.exe 檔。他提供了大多數流行的 GNU 工具用於編譯過程:
Download the rest of the build tools you will need from the PHP site at http://www.php.net/extra/win32build.zip.
下載其他的編譯需要的工具,從 php 的網站:
Get the source code for the DNS name resolver used by PHP at http://www.php.net/extra/bindlib_w32.zip. This is a replacement
for the resolv.lib library included in win32build.zip.
獲得 PHP 使用的用於 DNS 名字解析的原始碼。替換 win32build.zip 裡面的 resolv.lib 檔案
If you dont already have an unzip utility, you will need one. A free version is available from InfoZip.
如果你沒有解壓縮工具,你需要下載一個。 InfoZip 有一個免費的!!
Finally, you are going to need the source to PHP 4 itself. You can get the latest development version using anonymous CVS. If
you get a snapshot or a source tarball, you not only will have to untar and ungzip it, but you will have to convert the bare
linefeeds to crlfs in the *.dsp and *.dsw files before Microsoft Visual C++ will have anything to do with them.
At this point, you should have a usable php.exe in either your Debug_TS or Release_TS subdirectories.
這時,你可以得到可用的 php.exe 在你的 Debug_TS 或者 Release_TS 子目錄下面。
Repeat the above steps with php4isapi.dsp (which can be found in sapiisapi) in order to build the code necessary for
integrating PHP with Microsoft IIS.
對於 phpisapi.dsp 重複上面的步驟(在 sapiisapi 裡面可以找到).建立 Microsoft IIS 的 isapi 程式.