Differences in PHP versions

Source: Internet
Author: User
Tags php website vc9

Original: The difference between PHP versions


Think this has been written, found no, hasten to add.


PHP version, since entering 5, the release of the new version of the speed significantly increased, starting from PHP5.2, 5.3, 5.4, 5.5, is about 6.0.


Note: Ecshop users should consciously use the php5.2.17 version. Oh.


When we download PHP on the PHP website, we find the difference between VC6 and VC9, what does it mean?


VC6 is Legacy Visual Studio 6 compiler, using this version of the compiler to compile PHP code, using Apache as the application server, select VC6.

VC9 is the Visual Studio compiler, which is compiled with Microsoft's vs Editor. If you are using IIS as an application server, select Vc9.


So, we notice, php-5.2.17-nts-win32-vc6-x86.zip PHP decompression file, there is NTS and no NTS difference, what does this mean?


This will start with the PHP 5.2 series version. Starting with version 5.2.1, there is a difference between TS and NTS, thread safe(thread safe) and none thread safe (NTS, non-thread safe)


The Windows version of PHP from version 5.2.1 started with the thread safe (thread safe) and none thread safe (NTS, non-thread-safe) of the points, the difference is where? Which one should I use? Here is a simple introduction.


The first Windows edition of PHP3.0.17, released on October 20, 2000, started with a thread-safe version, because the Linux/unix system worked in a multi-process manner, and Windows systems were multithreaded. It is very slow to run PHP as CGI under IIS, because the CGI pattern is built on a multi-process basis rather than multithreading. We will configure PHP to run as ISAPI in Windows, because ISAPI is a multi-threaded way, so it's much faster.


However, there is a problem, many commonly used PHP extensions are developed in the Linux/unix of multi-process thinking, these extensions in the way ISAPI run error, it is likely to crash the IIS process, so for IIS, the CGI mode is the most secure way to run PHP, Only the CGI mode requires reloading and uninstalling the entire PHP environment for each HTTP request, and its consumption is huge.

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.


Depending on the webserver, which is the application server, when processing application requests, some are multithreaded rather than multi-process, so because threads are involved in shared registers and memory, it is easy to make mistakes (consider the case of C language pointers), Then the system will need time and resources to process the data in the register, ensure that they are consistent, that is, to ensure thread safety.


So whether to use thread safe, mainly to see the Web server's PHP request processing method, if it is multithreaded processing such as IIS ISAPI way, then choose thread Safety, if it is fastcgi then choose non-thread security.


Final recommendation: Under IIS, use the ISAPI mode to run PHP, use the thread safe version , use FastCGI mode to run PHP, use the None Thread safe (NTS, Non-thread-safe) version.


Note: php5.2 no vc9,php5.3, php5.4 no VC6. Oh. PHP5.5 start, do not support XP and Win2003, is Vc11, ha-ha.


In general, I like to use the decompression configuration version, more understanding of PHP settings and files. C language based Tongren can download the source to see, perhaps more experience.







Differences in PHP versions

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.