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)


Meet so Meet. C plusplus I-PLUS....
原文地址:https://www.cnblogs.com/iplus/p/4490241.html