Home > Backend Development > PHP Tutorial > Examples of viewing nginx, apache, php, and mysql configuration file paths in Linux

Examples of viewing nginx, apache, php, and mysql configuration file paths in Linux

小云云
Release: 2023-03-21 08:38:02
Original
1505 people have browsed it

How to check the nginx, apache, php, mysql configuration file paths in Linux. If you receive an environment configured by others, but no relevant documents are left. How to determine the correct path to load the file at this time. It can be judged by the following.

1. Determine apache
First execute the command to find the httpd path
ps aux | grep httpd
For example, the httpd path is /usr/local/apache/ bin/httpd
Then execute the following command
/usr/local/apache/bin/httpd -V | grep "SERVER_CONFIG_FILE"
You can find the configuration file path httpd.conf loaded during compilation
- For the V parameter, you can see the parameters configured during compilation

2. Determine nginx
First execute the command to find the nginx path
ps aux | grep nginx
If the nginx path is
/usr/local/nginx/sbin/nginx

Then execute the following command
/usr/local/nginx/sbin/nginx -V
Default is placed conf/nginx.conf in the installation directory
3. Determine mysql
First execute the command to find the mysql path
ps aux | grep mysqld
For example, the mysqld path is
/usr/bin/mysql

Then execute the following command
/usr/bin/mysql –verbose –help | grep -A 1 'Default options'
or
/usr/bin/mysql – print-defaults

4. Determine the configuration file path loaded by php
(1). You can check it through the php function phpinfo, write a file, and then access it with the URL to find it. The value corresponding to "Loaded Configuration File" is the configuration file loaded by php
(2). If it is nginx+php configuration, you can also find the php execution path
ps aux | grep php
For example, path For /usr/local/nginx/sbin/php-fpm
Then execute the following command
/usr/local/nginx/sbin/php-fpm -i | grep “Loaded Configuration File”
You can see Go to the configuration file loaded by php
(3). If it is an apache+mod_php configuration, you can also check the loaded php.ini path in the apache configuration file. Such as PHPIniDir "/usr/local/apache/conf/php.ini"

Of course there is also a simple method, which is to search through find
such as
find / -name nginx.conf
find / -name php.ini
find / -name my.cnf
find / -name httpd.conf

This method of finding requires Just brush the selection

Original text: http://www.phper163.com/archives/368

How to view nginx, The apache, php, and mysql configuration file paths are changed. If you receive an environment configured by others, but no relevant documents are left. How to determine the correct path to load the file at this time. You can judge by the following
1. Judge apache
First execute the command to find the httpd path
ps aux | grep httpd
For example, the httpd path is /usr/local/apache/bin/httpd
Then Execute the following command
/usr/local/apache/bin/httpd -V | grep "SERVER_CONFIG_FILE"
You can find the configuration file path httpd.conf loaded during compilation
-V parameter can be seen during compilation Configured parameters

2. Determine nginx
First execute the command to find the nginx path
ps aux | grep nginx
If the nginx path is
/usr/local /nginx/sbin/nginx

Then execute the following command
/usr/local/nginx/sbin/nginx -V
By default, it is placed in the installation directory conf/nginx. conf
3. Determine mysql
First execute the command to find the mysql path
ps aux | grep mysqld
For example, the mysqld path is
/usr/bin/mysql

Then execute the following command
/usr/bin/mysql –verbose –help | grep -A 1 'Default options'
or
/usr/bin/mysql –print-defaults

4. Determine the path of the configuration file loaded by php
(1) You can check it through the php function phpinfo, write a file, and then access it with the URL to find the value corresponding to "Loaded Configuration File". Configuration file loaded for php
(2), if it is nginx+php configuration, you can also find the php execution path
ps aux | grep php
For example, the path is /usr/local/nginx/sbin /php-fpm
Then execute the following command
/usr/local/nginx/sbin/php-fpm -i | grep “Loaded Configuration File”
You can see the configuration file loaded by php
(3) If it is an apache+mod_php configuration, you can also check the loaded php.ini path in the apache configuration file. Such as PHPIniDir "/usr/local/apache/conf/php.ini"

Of course there is also a simple method, which is to search through find
such as
find / -name nginx.conf
find / -name php.ini
find / -name my.cnf
find / -name httpd.conf

This method of finding requires Just brush the selection

The above is the detailed content of Examples of viewing nginx, apache, php, and mysql configuration file paths in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template