Nginx uses Apache PHP to handle the background

Source: Internet
Author: User
Tags apache php

Nginx itself does not own the PHP processing module, so you need to configure the reverse proxy, the PHP request to the other PHP parser execution, and then return the results to Nginx.

The current fashion is to use fast-cgi to configure PHP processing services. Its advantages are relatively concise, server load light. But the disadvantage is also obvious: unable to view the PHP processing status.

For example, sometimes the site because the load is too high, PHP processing threads have all blocked, it will cause the site can no longer respond to PHP services. Using the FastCGI method, you cannot see which scripts are processing too long and block the PHP processing thread.

The advantage of Apache is that it's good to see which PHP scripts are processing too long and block the number of active processes.

The following is the way Nginx uses Apache PHP to handle the background:

Configure Apache to run correctly on port 8001.

Modify Nginx Virtual host configuration and other PHP scripts to be parsed by Apache

Restart Nginx and Apache

Note that if you want to see the processing status of PHP, you can install the Apache monitoring module.

Nginx uses Apache PHP to handle the background

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.