前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Windows PHP 中 VC6 X86 和 VC9 X86 的区别及 Non Thread Safe 的意思

Windows PHP 中 VC6 X86 和 VC9 X86 的区别及 Non Thread Safe 的意思

作者头像
黄规速
发布2022-04-14 20:27:51
4220
发布2022-04-14 20:27:51
举报

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需要说明是否需要开启线程安全:

代码语言:javascript
复制
–with-tsrm-st          Use SGI's State Threads
–with-tsrm-pthreads    Use POSIX threads (default)
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2012-04-24 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Which version do I choose?
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档