Analysis and interpretation of multiple versions of PHP _php Digest

Source: Internet
Author: User
Tags garbage collection vc9

PHP version mainly divided into three: PHP4/PHP5/PHP6
Among them, PHP4 because of too old, to OO support weak has been basically eliminated, is not detailed.
and PHP6 because basically no production line application, still basically just a concept product, so also not detailed.

The PHP5 version is divided into three main branches: PHP5.2, php5.2.x and PHP5.3
So how do we choose to apply our own version of the project?
Pre-PHP5.2 versions are not worth considering because of some feature flaws or bugs.
Mainstream PHP program for php5.2.x compatibility is best, and each version of the upgrade brings security and stability improvement, so it is advisable to pick the latest version. The current PHP5.2 series is the latest PHP5.2.14
And if the product is the development of their own use, PHP5.3 in some ways more advantages, more than a good stability, adding a lot of PHP5.2 do not have functions, such as built-in PHP-FPM, more complete garbage collection algorithm, the introduction of namespaces, SQLITE3 support and so on, Is the version of the deployment project that is worth considering.

In addition to the version number, the same version of the PHP version is also different, and in the selection of PHP extensions to be aware of.

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 are are using PHP with Apache 1 or Apache2 from apache.org your need to use the VC6 versions of PHP
If you are are using PHP with IIS your 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 in improvements and performance. The VC9 versions require to have the Microsoft 2008 C + + Runtime (x86) or the Microsoft 2008 C + + Runtime (x64) Installe D
Don't use VC9 version with apache.org binarieshttp://dev.meettea.com

Which version should I choose?
If you are using PHP under Apache1 or apache2, you should select the VC6 version
If you are using PHP under IIS, you should select the VC9 version
VC6 versions are compiled using visual Studio6
VC9 is compiled using Visual Studio 2008 and improves performance and stability. VC9 version of PHP requires you to install Microsoft 2008 C + + Runtime
Do not use the VC9 version under Apache

TS and NTS
TS refers to thread Safety, which is typically selected when IIS is loaded as ISAPI.
NTS is None-thread Safe, which is typically run in fast CGI, with better performance.
Here's some information, from http://koda.javaeye.com/blog/662034.
The first Windows version of PHP3.0.17, released on October 20, 2000, started with a thread-safe version, because the Windows system is a multithreaded way of working with the Linux/unix system, which uses multiple processes. Running PHP in CGI under IIS can be very slow because the CGI pattern is based on multiple processes, not multithreading. Normally we would configure PHP to run as an ISAPI, and ISAPI is a multithreaded way, which is much faster. There is a problem, however, that many of the commonly used PHP extensions are developed with Linux/unix ideas, which can cause errors to take down IIS when they run in the ISAPI mode. Therefore, the CGI mode is the safest way to run PHP under IIS, but the CGI model needs to reload and uninstall the entire PHP environment for each HTTP request, and its consumption is enormous.
To accommodate the efficiency and security of PHP under IIS, Microsoft has fastcgi solutions. FASTCGI allows PHP processes to be reused rather than to restart a process with every new request. FastCGI can also allow several processes to execute at the same time. This solves the problem that the CGI process mode consumes too much, and utilizes the advantage that the CGI process mode has no 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 does not require thread safety checks, with none thread safe (NTS, non-threading security) Version to better improve efficiency.


How do I see the version of PHP that is currently running? A very simple way is to phpinfo ();
Thread Safety Disabled is nts,enabled is TS
Configure command to see VC98 typeface is Vc6,compiler marked MSVC9 (Visual C + + 2008) is VC9

In addition, by the way of Windows relatively simple and convenient PHP configuration method, what the online teaching replication php.ini to the Windows directory, copy Xxxxx.dll to System32, too ugly.
1, download the zip version of PHP
2, download the corresponding extension, modify good php.ini, add module mapping
3, environment variables in the path plus PHP directory. As long as one is enough,/bin and/ext do not need to add.
4, the environment variable defines a PHPRC variable, the content of the php.ini storage path.
Complete. Many articles mention the need to reboot the system, but from what I've seen, it's not necessary to restart the Web service at most.

If you are using Linux, ignore this article.
Revised: 2010-11-03

    1. Watched the revision of cabbage (aiyooyoo.com), IIS installation php-cgi,3, 42 steps can be omitted, ISAPI mode required.
    2. The PHP version named Windows is more appropriate

At the last, the recent thinking of a lot of things, if the written and lack of depth and strength, but also need to thick thin hair.

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.