Nginx and PHP

Source: Internet
Author: User

Nginx and PHP combined, nginx parsing Dynamic Web pages, and PHP Dynamic Web page to the PHP processing, the solution:

---from the nginx angle

  • Using Nginx's proxy module
  • Using the FastCGI module

---from the perspective of PHP

  • Run in PHP-FPM mode
  • PHP comes with the fastcgi server
  • The spawn-fcgi of the lighttpd belt

1) PHP Installation

  • Typical compilation installation
  • Yum installation: Yum install PHP

To restart PHP:

  • Killall PHP-FPM
  • /opt/php-5.3.22/sbin/php-fpm

2) Management PHP-FPM

Control signals that can be used by the master master process of PHP-FPM:

  • SIGINT, Sigterm: terminate the process immediately
  • Sigquit: Smooth Termination process
  • SIGUSR1: Reopen log file
  • SIGUSR2: Smooth reload of all worker processes and reload configuration and binary modules

3) In addition to the main profile nginx.conf in Nginx, there are two fastcgi related profiles: fastcgi.conf and Fastcgi_params

4) Monitor the status of PHP-FPM by configuring php-fpm.conf and nginx.conf configuration files

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.