Differences between PHP version VC6 and VC9, Thread safe and none-thread safe, etc.

Source: Internet
Author: User
Tags vc9 microsoft c
PHP version VC6 and VC9, Thread safe and none-thread safe and other differences

Recently found a lot of PHP programmers on the PHP version of knowledge is not very clear, they also read a lot of similar articles, or feel not clear and comprehensive, the online conclusion is ambiguous, here, give the most complete even arbitrary interpretation.

??? This article explains: The difference and choice between VC6 and Vc9,thread safety and None-thread safe,apache module and fastcgi.

The big version of PHP is divided into three main branches: PHP4/PHP5/PHP6

Among them, PHP4 because too old, the poor support of OO has been basically eliminated, please disregard PHP4.

PHP6 because there is no application on the production line, but also basically a concept product, a lot of features have been implemented on the PHP5.3.3, so do not elaborate, please disregard PHP6.

The PHP5 version is divided into four main branches: PHP5.2, php5.2.x, PHP5.3, and the PHP5.4 of the previous release.

So how do we choose the version that applies to our project?

??? The previous version of PHP5.2 is not worth considering because of some feature defects or bug,php5.2 previous versions. PHP5.4 is also in beta trial version number, non-stable version, please disregard PHP5.4.

Mainstream PHP programs have the best compatibility with php5.2.x, and the upgrade of each version number brings security and stability improvements, so pick the latest version. At present the PHP5.2 series is the newest PHP5.2.17.

And if the product is self-development of their own use, PHP5.3 in some aspects of the more advantageous, in the stability of a better, increased a lot of PHP5.2 does not have the function, such as built-in php-fpm, more perfect garbage collection algorithm, the introduction of namespaces, SQLITE3 support and so on, is a version worth considering for the deployment project, PHP5.3.3 is highly recommended.

In addition to the version number, the same version number of the PHP version is also different, and in the choice of PHP extension should be noted.

    • Install version: an executable MSI format installation package.
    • Zip version: Unzip can be used. No difference from the install version. We recommend that you select the zip version.
    • Debug version: Please ignore.

VC6 and VC9

For VC6 or VC9 version of the choice, the PHP official website has a detailed description, the original text is as follows:

Which version do I choose? If you is using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHPIF for the using PHP With IIS should use the VC9 versions of PHPVC6 versions is compiled with the legacy Visual Studio 6 compilerVC9 Versi ONS is compiled with the Visual Studio compiler and has improvements in performance and stability. The VC9 versions require to the Microsoft C + + runtime (x86) or the Microsoft C + + runtime (x64) Installe DDo VC9 version with apache.org binaries
Which version should I choose? If you use PHP under Apache1 or apache2, you should choose the version of VC6 if you use PHP under IIS should choose VC9 version VC6 version using Visual Studio6 compile VC9 using Visual Studio 2008 compilation, and improved performance and stability. VC9 version of PHP requires you to install Microsoft C + + runtime do not use VC9 version under Apache

TS and NTS

TS refers to thread Safety, which is threaded, and is typically selected when IIS is loaded in ISAPI mode.

NTS is the None-thread Safe, usually in fast CGI run time to choose this version, with better performance.

The first Windows version of PHP3.0.17, released on October 20, 2000, started with a thread-safe version, because unlike the Linux/unix system, which works in a multi-process manner, Windows systems work in a multi-threaded way. It is very slow to run PHP as CGI under IIS, because the CGI pattern is built on a multi-process basis, not multithreaded. In general, we will configure PHP to run in ISAPI way, ISAPI is multi-threaded way, so much faster. There is a problem, however, that many commonly used PHP extensions are developed with Linux/unix's multi-process thinking, which can be faulted when running in ISAPI mode. Therefore, the CGI mode under IIS is the safest way to run PHP, but the CGI mode requires reloading and uninstalling the entire PHP environment for each HTTP request, which consumes a huge amount.

To take into account the efficiency and security of PHP under IIS, Microsoft has given the fastcgi solution. FastCGI can allow the PHP process to be reused instead of every new request to re-open a process. FastCGI can also allow several processes to execute simultaneously. This solves the problem that the CGI process pattern consumes too much, and the CGI process pattern does not have the advantage of the thread security problem.

Therefore, if you are using ISAPI to run PHP, you must use the thread safe version, while running PHP in fastcgi mode, there is no need to use thread security, with none thread safe (NTS, non-thread-safe) Version to better improve efficiency.

How do I see the version of PHP currently running? A very simple way is to phpinfo ();

Thread Safety Disabled is nts,enabled is TS

Configure command to see the VC98 typeface is Vc6,compiler marked MSVC9 (Visual C + + 2008) is VC9

Under WIN7: IIS7+NTS+FASTCGI+VC9 is the best partner or APACHE+FASTCGI+NTS+VC6.

Under WinXP: Apache+ts+apache module +VC6 is the most suitable partner.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.