search
Homephp教程php手册Introduction to the organizational structure of nginx php-fpm configuration file_php basics

1.nginx configuration file path
Generally speaking, when installing nginx, the default path of the configuration file is /usr/local/nginx/conf/nginx.conf.
We can use a link file to point the conf directory to a specific directory to facilitate management. For example, the author's company likes to centralize all server configuration files in /home/server_config, then create a new subdirectory nginx in this directory, and then point /usr/local/nginx/conf to /home/server_config through the link file /nginx.

2.Virtual host configuration file path
Usually, the author's company will write the configuration file of each Virtualhost into a separate file. These separate files live in separate projects.

But there is a trick. We can create a subdirectory include in the directory where nginx.conf is located. Under the include directory, there is a series of link files that point to the Virtualhost configuration file.

3.php-fpm configuration file path
Usually, the php-fpm execution file is in the sbin directory under the php installation path. (Here, there is a digression. When installing PHP, the installation directory generally defaults to /usr/local. This is not a good choice, because sometimes, multiple versions of PHP may need to exist on one server at the same time. A A good implementation is to install different versions of php in /usr/local/php-xxx/, where xxx represents the version of php).
The configuration file of php-fpm is placed in the etc directory under the php installation path by default. But in fact, the configuration file of php-fpm can specify the path when starting php-fpm, and different php-fpm instances can specify different configuration files. And this also has practical significance: Nginx may be monitoring multiple VirtualHosts at the same time on one server. When restarting a Host, you only need to restart the corresponding php-fpm instance.

4. The configuration file path of each pool
can be specified by yourself. But generally, we will manage it centrally. The author's company chose to place it under /var/run and create a folder for each instance. In addition to php-fpm, the folder also contains the corresponding pid file and the corresponding unix:socket file. .
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),