Apache Switch to Nginx, PHP programming model is the same?

Source: Internet
Author: User
I heard that nginx does not need more than one process, that is not multiple requests are using the same process, will not interfere?

Does PHP code need to be rewritten?

Reply content:

I heard that nginx does not need more than one process, that is not multiple requests are using the same process, will not interfere?

Does PHP code need to be rewritten?

Completely unnecessary, and PHP has nothing to do, PHP is a scripting language, you have a virtual machine to deal with these things, you do not need to care about what platform to run

It's not completely unaffected. Some variables such as _server[php_self] are related to Apache or Nginx.

Using PHP, you can say that you only need to focus on the PHP interpreter, regardless of which Web server, you need to invoke the interpreter to execute the script.

Not only does not disturb ... Conversely, this single-process (threading) model performs better in high concurrency ... Like Nodejs ...
Because of high concurrency: A multi-process (threading) model can cause most of the CPU's computational power to be wasted on its process (thread) switching ...

The $_server variable may have an effect, and then the rewrite rule needs to be modified basically almost

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