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