Windows PHP 中 VC6 X86 和 VC9 X86 的區別及 Non Thread Safe 的意思

來源:互聯網
上載者:User

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)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.