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

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

(0)
s19930811s19930811
上一篇 2015-06-15 18:24
下一篇 2015-06-16 21:33

相關推薦

  • nginx配置(一)

    Nginx:http協議:web服務器(類似于httpd)、http reverse proxy(類似于httpd)、imap/pop3 reverse proxy NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/…

    Linux干貨 2017-05-05
  • memcache

      memcached: memcached is a high-performance, distributed memory object caching system, generic in nature, but&nbsp…

    Linux干貨 2016-11-01
  • 文件的查找命令 find 和 locate

    文件的查找命令 find 和 locate find 功能:實時查找工具,通過遍歷指定路徑完成文件查找 工作特點: ?  查找速度略慢?  精確查找?  實時查找?  可能只搜索用戶具備讀取和執行權限的目錄 語法:   find [OPTION]… [查找路徑] [查找條件] [處理動作] 查找路徑:指定具…

    Linux干貨 2016-08-16
  • 13grep和正則表達式

    grep:Global search REgular expression and Print out the line . 文本過濾工具,根據用戶指定的模式對目標文本進行匹配檢查;打印匹配到的行。過濾即不改變原來文本數據。 grep [options] PATTERN [file…] –color=auto: 對匹配到的文本著色顯示…

    Linux干貨 2016-11-27
  • find可以這么用

    在工作中不可或缺的工具find:查找系統中的各種文件,對查找的文件進行操作,這就是find的作用。進入正題: 1、查找下系統中有一下系統中有幾個文件叫issue的     [root@localhost private]#find / -name issue      …

    Linux干貨 2017-03-05
  • poweroff

    poweroff命令詳解

    Linux干貨 2018-03-04
欧美性久久久久