PHP thread-safe and non-thread-safe versions of the difference _php tutorial

Source: Internet
Author: User
I will see a PHP tube in the PHP version of A, None-thread safe and the Thread safe version, then what is the difference between the two versions, but a closer look at the introduction is to establish that we use thread-safe, rather than a wire program security for testing.

First of all, in the literal sense, none-thread safe is non-thread-safe, do not thread security at execution time, thread safe is threaded, thread security is performed, to prevent new requirements to start a new thread of CGI The execution method exhausts the system resources.

Let's look at two ways of executing PHP: ISAPI and fastcgi. FastCGI execution is performed in a single thread, so there is no need for thread security checks, and removing thread security checks can improve execution efficiency, so if PHP is executed in FastCGI (whether with IIS 6 or IIS 7), it is recommended to download, execute Non-thread Safe PHP (PHP's two-bit? n has the evil spirit N package? Way: MSI, Zip,? Zip kit). Thread safety checks are prepared for the ISAPI way of PHP, because there are many PHP modules that are not thread-safe, so you need to use the thread safe PHP.

Speaking of which, you should know how to choose which version of PHP. None-thread safe or Thread safe, which would you choose?

Final summary

1.Non thread safe (non-thread safe) version PHP is available on Web servers using CGI and fastcgi, such as NGINX,LIGHTTPD and IIS in CGI mode

2.Thread Safe (thread safe) version PHP is available on Web servers that use ISAPI or module, such as the IIS ISAPI mode or Apache module mode

http://www.bkjia.com/PHPjc/633179.html www.bkjia.com true http://www.bkjia.com/PHPjc/633179.html techarticle I will see in PHP tube side PHP version of A, None-thread safe and Thread safe version, then the two versions exactly what the difference, but carefully look at the introduction is to build US ...

  • 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.