PHP5.3以后 For Windows 提供了四個版本VC9 x86 Non Thread Safe、VC9 x86 Thread Safe、VC6 x86 Non Thread Safe、VC6 x86 Thread Safe
在 官網 左邊欄有提示:
Which version do I choose?
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed
Do NOT use VC9 version with apache.org binaries
VC9 versions of Apache can be fetched at Apache Lounge. We use their binaries to build the Apache SAPIs.
一、如何選擇PHP5.3的VC9版本和VC6版本
VC6就是legacy Visual Studio 6 compiler,就是使用vs6編譯的。
VC9就是the Visual Studio 2008 compiler,就是使用vs9編譯的。
在Windows選擇下載哪個版本的PHP呢?
如果你是在windows下使用Apache+PHP的,請選擇VC6版本;
如果你是在windows下使用IIS+PHP的,請選擇VC9版本。
二、如何選擇PHP5.3的Thread Safe和Non Thread Safe版本
先從字面意思上理解,Thread Safe是線程安全,執行時會進行線程(Thread)安全檢查,以防止有新要求就啟動新線程的CGI執行方式而耗盡系統資源。Non Thread Safe是非線程安全,在執行時不進行線程(Thread)安全檢查。
再來看PHP的兩種執行方式:ISAPI和FastCGI。
ISAPI執行方式是以DLL動態庫的形式使用,可以在被用戶請求后執行,在處理完一個用戶請求后不會馬上消失,所以需要進行線程安全檢查,這樣來提高程 序的執行效率,所以如果是以ISAPI來執行PHP,建議選擇Thread Safe版本;
而FastCGI執行方式是以單一線程來執行操作,所以不需要進行線程的安全檢查,除去線程安全檢查的防護反而可以提高執行效率,所以,如果是以 FastCGI來執行PHP,建議選擇Non Thread Safe版本。
官方并不建議你將Non Thread Safe 應用于生產環境,所以我們選擇Thread Safe 版本的PHP來.
注意在Linux/Unix下,肯定沒有VC9版本和VC6版本之分,但有線程安全之分。而在linux下安裝PHP一般編譯安裝的,configure需要說明是否需要開啟線程安全:
–with-tsrm-st Use SGI's State Threads –with-tsrm-pthreads Use POSIX threads (default)
轉自:http://blog.csdn.net/hguisu/article/details/7492486
原創文章,作者:s19930811,如若轉載,請注明出處:http://www.www58058.com/2966