Home >Backend Development >PHP Tutorial >Tips for choosing non-thread-safe and thread-safe versions of PHP

Tips for choosing non-thread-safe and thread-safe versions of PHP

WBOY
WBOYOriginal
2016-07-29 09:00:17818browse

Starting from PHP5.2.10 version (there are currently two versions of PHP5.2.10 and 5.3), there are two versions available, None-Thread Safe and Thread Safe. What are the differences between these two versions? As a user How should we choose? Juyou will tell you about it below.
Starting from PHP5.2.10 version (there are currently two versions of PHP5.2.10 and 5.3), there are two versions available, None-Thread Safe and Thread Safe. What are the differences between these two versions and what should users do? How to choose? Juyou will tell you about it below.

First understand it literally, None-Thread Safe means non-thread safety, no thread safety check is performed during execution; Thread Safe means thread safety, and thread safety check is performed during execution to prevent The CGI execution method of starting a new thread when there is a new request exhausts system resources.

Let’s look at the two execution methods of PHP: ISAPI and FastCGI. The FastCGI execution method uses a single thread to perform operations, so there is no need to perform thread safety checks. Removing the protection of thread safety checks can improve execution efficiency. Therefore, if FastCGI (whether paired with IIS 6 or IIS 7) is used to execute PHP, It is recommended to download and execute non-thread safe PHP (PHP binary files have two packaging methods: msi and zip, please download the zip package). The thread safety check is prepared for ISAPI PHP. Because many PHP modules are not thread safe, you need to use Thread Safe PHP.

At this point, everyone should know how to choose which version of PHP. None-Thread Safe or Thread Safe, which one will you choose?

The version of PHP under Windows is updated very quickly. The latest version is PHP7. The current Windows version can be downloaded from PHP official PHP For Windows (http://windows.php.net/download/). When downloading, There are four versions: VC9 x86 Non Thread Safe, VC9 x86 Thread Safe, VC6 x86 Non Thread Safe, and VC6 x86 Thread Safe. So what's the difference between these versions?

The VC9 version is compiled with legacy VS 2008, and the VC6 version is compiled with legacy VS6.

If you are using IIS+PHP under windows, you need to download the VC9 version.
If you are using Apache+PHP under windows, you need to download the VC6 version.

Non Thread Safe refers to non-thread safety, and Thread Safe refers to thread safety.

If you use ISAPI to run PHP, you must use the Thread Safe (thread safe) version; if you use FastCGI mode to run PHP, there is no need to use thread safety check, use None Thread Safe (NTS, non-thread safe) version can better improve efficiency.

In this way, how to choose the PHP version that suits you is easily solved. Go download the PHP that suits your system.

I hope this article on choosing tips for non-thread-safe and thread-safe versions of PHP can be helpful to you. If you find this website maintenance tutorial useful, don’t forget to recommend it to your friends! If you have good experience methods, you might as well share them with everyone: if everyone comes up with an experience, then we will all gain a bunch of additional experience from others.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the selection skills of non-thread-safe and thread-safe versions of PHP, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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