background image

php5.3.21.tar.gz

至于

VC6 和 VC9,一个支持 apache 一个支持 IIS.但是试了下 VC9 用在 apache 上没问题 . 

线程安全

Thread Safe(TS)和非线程安全(NTS),就是在执行时是否进行线程安全检查,以防止

有新要求就启动新建成的

CGI 执行方式,进而耗尽系统资源.

执行方式有

ISAPI 和 FastCGI,

前者

ISAPI(Internet Server Application Programming Interface)是以 DLL 动态链接库的形式使

,在用户请求后执行,在处理完一个用户请求后不会马上消失,因此需要进行线程安全检查.

以此来提高程序的执行效率

. 所以以 ISAPI 的方式来执行 PHP,最好选择 Thread Safe 版本也

就是我们下载的版本

,对应的 apache 的设置在第 4 段末尾有. 

FastCGI 是以单一线程执行,所以不需要进行线程安全检查,因为没有了线程安全检查,反而加
快了

PHP 的执行效率.所以如果用 FastCGI 来执行 PHP,最好选择 Not Thread Safe 版本 .而在

apache 中就需要设置成下面的.(

这里我们配置的环境不用设置

)

[php] view plaincopyprint?

1. ScriptAlias /php/ "F:/php/PHP5"  
2. Action application/x-httpd-php "/php/php-cgi.exe"  

ScriptAlias /php/ "F:/php/PHP5"
Action application/x-httpd-php "/php/php-cgi.exe"

(

Notice: 

如果安装其它的集成环境

,比如 wamp 会报错,由于这是 VC9 的原因.会导致加载

PHPIniDir 后 apache 不能重启.同理,如果有 phper 的机器装不上 APACHE.PHP5.3.8.解决办法

2 个,第一办法是建议换成 VC6 的版本.官方 apache 手册也说了 VC 9 for apache unstable 

behaviour,需要大家重新安装.设置跟 5.3.8 一样.第二个办法是装一个 VC++2008 的运行环境,

具体解决方法请看下面的第

10 条.

Windows users: please mind that we do no longer provide builds created with Visual Studio C++ 
6. It is impossible to maintain a high quality and safe build of PHP for Windows using this 
unmaintained compiler.

For Apache SAPIs (php5_apache2_2.dll), be sure that you use a Visual Studio C++ 9 version of 
Apache. We recommend the Apache builds as provided by ApacheLounge. For any other SAPI 
(CLI, FastCGI via mod_fcgi, FastCGI with IIS or other FastCGI capable server), everything 
works as before. Third party extension providers must rebuild their extensions to make them 
compatible and loadable with the Visual Studio C++9 builds that we now provide.)