如何选择PHP版本?
2012-10-21 14:48
288 查看
happydagui: ISAPI是windows的东西,FastCGI在编译PHP是可选项。大部分wamp的组合,包括默认设置,都是采用php-cgi方式,因此启用的是Thread Safe模式。
从php官网下载的php版本包含thread safe和non thread safe版本的。前者php目录包含php5apache2_2.dll,后者不包含该文件。如果不采用FastCGI,都需要该文件,因此只能采用thread safe模式。如果采用FastCGI模式,需要另外下载fastcgi模块,而不再需要php5apache2_2.dll,具体配置请参考另一篇文章《在 windows 下安装 apache2.2.8+fastcgi+php 》。
一、如何选择 PHP5.3 的 VC9 版本和 VC6 版本 版本是使用 Visual Studio 6 编译器编译的,如果你的 PHP 是用 Apache 来架设的,那你就选择 VC6 版本。
版本是使用 Visual Studio 2008 编译器编译的,如果你的 PHP 是用 IIS 来架设的,那你就选择 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 版本。
附一:官方原文: <http://windows.php.net/download#php-5.4-nts-VC9-x86> 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.
来源: <http://www.5eyi.com/how-to-choose-the-php-version/#more-461>
附二:采用标准模式以及FastCGI模式运行的PHP 前者是大多数wamp组合,包括默认设采用的方式,因此启用的是Thread Safe模式
Apache 2.0 Handler with Thread Safe enabled
CGI/FastCGI with Thread Safe disabled
从php官网下载的php版本包含thread safe和non thread safe版本的。前者php目录包含php5apache2_2.dll,后者不包含该文件。如果不采用FastCGI,都需要该文件,因此只能采用thread safe模式。如果采用FastCGI模式,需要另外下载fastcgi模块,而不再需要php5apache2_2.dll,具体配置请参考另一篇文章《在 windows 下安装 apache2.2.8+fastcgi+php 》。
一、如何选择 PHP5.3 的 VC9 版本和 VC6 版本 版本是使用 Visual Studio 6 编译器编译的,如果你的 PHP 是用 Apache 来架设的,那你就选择 VC6 版本。
版本是使用 Visual Studio 2008 编译器编译的,如果你的 PHP 是用 IIS 来架设的,那你就选择 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 版本。
附一:官方原文: <http://windows.php.net/download#php-5.4-nts-VC9-x86> 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.
来源: <http://www.5eyi.com/how-to-choose-the-php-version/#more-461>
附二:采用标准模式以及FastCGI模式运行的PHP 前者是大多数wamp组合,包括默认设采用的方式,因此启用的是Thread Safe模式
Apache 2.0 Handler with Thread Safe enabled
CGI/FastCGI with Thread Safe disabled
相关文章推荐
- PHP版本如何选择?应该使用哪个版本?
- PHP版本如何选择?应该使用哪个版本?
- 如何为自己的php版本选择正确的xdebug版本
- PHP版本如何选择?应该使用哪个版本?
- windows下php的版本如何选择?
- Xdebug如何选择PHP版本
- PHP版本如何选择?应该使用哪个版本?
- PHP5.3中关于VC9和VC6以及Thread Safe和Non Thread Safe版本选择的问题
- 如何选择SDK版本
- 我如何选择了流行的PHP
- Windows下的PHP开发环境搭建——PHP线程安全与非线程安全、Apache版本选择,及详解五种运行模式。
- Cisco IOS如何选择软件版本
- 我们到底应该如何选择开发语言或工具的版本
- Linux-09、10-如何选择合适的Linux系统版本学习&服务器领域如何选择适合的CentOS Linux版本(L003-23,24)
- PHP关于VC9和VC6的区别以及是否线程安全的版本选择
- 64位Java开发平台的选择,如何区分JDK,Tomcat,eclipse的32位与64版本
- 如何将简单CMS后台管理系统示例转换为Java、Php等不同后台语言的版本
- 如何查看php版本
- 64位Java开发平台的选择,如何区分JDK,Tomcat,eclipse的32位与64版本
- PHP如何下载对应的XDebug版本