search
Homephp教程php手册PHP中基于ts与nts版本- vc6和vc9编译版本的区别详解

PHP中基于ts与nts版本- vc6和vc9编译版本的区别详解

Jun 13, 2016 am 11:54 AM
legacyntsphpvisualandthe differenceandbased onVersionofcompileDetailed explanation

VC6:legacy Visual Studio 6 compiler,就是使用这个编译器编译的。
VC9:Visual Studio 2008 compiler,就是用微软的VS编辑器编译的。
由于apache.org只提供VC6的版本,所以使用原版apache时只能使用VC6。(www.apachelounge.com上有apache VC9的版本提供,应该可以和PHP VC9配合,没用过)
TS:Thread Safe 线程安全, 执行时会进行线程(Thread)安全检查,以防止有新要求就启动新线程的CGI执行方式而耗尽系统资源
NTS:Non Thread Safe 非线程安全, 在执行时不进行线程(Thread)安全检查
PHP的两种执行方式:ISAPI和FastCGI。
ISAPI(Internet Server Application Programming Interface)执行方式是以DLL动态库的形式使用,可以在被用户请求后执行,在处理完一个用户请求后不会马上消失,所以需要进行线程安全检查,这样来提高程序的执行效率,所以如果是以ISAPI来执行PHP,建议选择Thread Safe版本
apache中的配置方式:

#下面这个是加载TS版本的php必须的
LoadModule php5_module “xxx/php5apache2_2.dll”
#下面这行可有可无

AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt


FastCGI执行方式是以单一线程来执行操作,所以不需要进行线程的安全检查,除去线程安全检查的防护反而可以提高执行效率,所以,如果是以FastCGI来执行PHP,建议选择Non Thread Safe版本。
apache中的配置方式:

#下面这两行是加载NTS版本的php必须的,不可以直接写成Action application/x-httpd-php “c:/wamp/bin/php/php3.5.6/php-cgi.exe”!
ScriptAlias /php/ "C:/wamp/bin/php/php3.5.6/"
Action application/x-httpd-php “/php/php-cgi.exe”

#另外,还要有之前的AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt,这样才能认识php格式的文件

#这样配置完可能还会因为权限问题而无法用php-cgi.exe解析php网页,所以还要加上下面这段


    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

官方并不建议你将Non Thread Safe 应用于生产环境,所以我们选择Thread Safe 版本的PHP来使用。
XAMPP在http-xampp.conf中默认配置是使用ISAPI的方式

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)