PHP版本VC6和VC9、Non Thread Safe和Thread Safe的区别
想更新个 PHP 的版本, PHP 的 windows 版本已经分离出来了,见 http://windows.php.net/download/ ,但是上面有很多不同的版本,包括 VC9, VC6, ?x86 Non Thread Safe, x86 Thread Safe, 好像没有 x64 版本的,(现在特别喜欢用 64 位的软件),版本有点多,主要的区别和如何选择不同的版本如下:
VC6 版本是使用 Visual Studio 6 编译器编译的,如果你是在 windows 下使用 Apache+PHP 的,请选择 VC6 版本。
VC9 版本是使用 Visual Studio 2008 编译器编译的,如果你是在 windows 下使用 IIS+PHP 的,请选择 VC9 版本。
Non Thread Safe
就是非线程安全,在执行时不进行线程(
Thread
)安全检查;
Thread Safe
是线程安全,执行时会进行线程(
Thread
)安全检查,以防止有新要求就启动新线程的
CGI
执行方式而耗尽系统资源;
Windows 下的 PHP 主要有两种执行方式: ISAPI 和 FastCGI 。
?????? ISAPI 执行方式是以 DLL 动态库的形式使用,可以在被用户请求后执行,在处理完一个用户请求后不会马上消失,所以需要进行线程安全检查,这样来提高程序的执行效率,所以如果是以 ISAPI 来执行 PHP ,建议选择 Thread Safe 版本;
?????? FastCGI 执行方式是以单一线程来执行操作,所以不需要进行线程的安全检查,除去线程安全检查的防护反而可以提高执行效率,所以,如果是以 FastCGI 来执行 PHP ,建议选择 Non Thread Safe 版本。
?????? 官方并不建议你将 Non Thread Safe 应用于生产环境。
?????
知识补充:
???? ? ISAPI 缩写词为 Internet Server Application Programming Interface 为 Microsoft 所提的 Internet server 的 API 。 ISAPI 服务器扩展是可以被 HTTP 服务器加载和调用的 DLL 。 Internet 服务器扩展也称为 Internet 服务器应用程序 (ISA) ,用于增强符合 Internet 服务器 API (ISAPI) 的服务器的功能。 ISA 通过浏览器应用程序调用,并且将相似的功能提供给通用网关接口 (CGI) 应用程序。
?????? FastCGI 是一个程序接口,它能加速公共网关接口( CGI ), CGI 是一种用最常见的方式使 Web 服务器调用应用程序的 Web 应用程序。按一个 FastCGI 工具来看,用户要求进入一个网站并使用一个专门的应用软件的话,使用 FastCGI 能够快 3 到 30 倍。 FastCGI 是 Web 服务器的一种 插件。为了获得良好的性能,它要求对现有服务器应用程序(比如 Perl 、 Tcl 脚本和 C 、 C++ 程序)做细小的改动。
???? 基本上, FastCGI 是一个在单一步骤中管理多重 CGI 请求的程序,为每个请求减少了许多程序指令。没有 FastCGI 的话,每当用户请求某一服务时都会导致 Web 服务器打开 一个新的能控制和执行这项服务的程序,然后关闭它。有了 FastCGI 的话,一个步骤的耗费会被所有当前正处理的请求所分担。与 CGI 不同,有了 FastCGI 的话,每个步骤是独立于 Web 服务器运行的, 这样就提供了更多的安全。 FastCGI 是独立代码的。它的版权属于 Open Market 公司,该公司提供 FastCGI 的免费使用并且将其作为一个公开标准。 FastCGI 提供了唯一一个可以跨平台和在任何 Web 服务器上使用的 无知识产权的方法。

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version
God-level code editing software (SublimeText3)