Home  >  Article  >  Backend Development  >  LNMP environment construction (2) Integrating Nginx and PHP

LNMP environment construction (2) Integrating Nginx and PHP

WBOY
WBOYOriginal
2016-08-08 09:31:22878browse

There are many ways to install Nginx. Here we compile the source code for installation and use the following commands:


If the following error occurs during the installation process:


You need to install PCRE first:


Installation After completion, the Nginx installation directory is /usr/local/nginx.

Next, modify the nginx configuration file (/usr/local/nginx/conf/nginx.conf) so that it can handle PHP scripts:

Finally, when starting Nginx, you need to first Start PHP-FPM.


For Nginx restart and shutdown operations, you can use the following commands:


And PHP-FPM It is more troublesome. You need to use ps -ef | grep php-fpm to get the process ID of the master process, and then use kill -USR2:

Note: -USR2 parameter is restart, -INT parameter is Close

The above introduces the LNMP environment construction (2) Integrating Nginx and PHP, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:yii scheduled tasksNext article:yii scheduled tasks