How to view Nginx, Apache, PHP, MySQL configuration file paths in Linux, if you receive an environment that someone else has configured, but leave no documentation. At this point how to determine the correct load file path is found. Can be judged by the following.
1. Judging Apache
First execute the command to find the httpd path
PS aux | grep httpd
If the httpd path is/USR/LOCAL/APACHE/BIN/HTTPD
Then execute the following command
/usr/local/apache/bin/httpd-v | grep "Server_config_file"
To find the configuration file path that was loaded at compile time httpd.conf
The-v parameter can see the parameters that are configured at compile time
2. Judging 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 in the installation directory conf/nginx.conf
3. Judging MySQL
First execute the command to find the MySQL path
PS aux | grep mysqld
If 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 PHP load profile path
(1), can be viewed through PHP function phpinfo, write a file, and then use the URL to access, find "Loaded configuration file" corresponding to the value of the PHP loaded configuration files
(2), if it is a 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 PHP loaded configuration file
(3), if it is a apache+mod_php configuration, you can also view the loaded php.ini path in the Apache configuration file. such as Phpinidir "/usr/local/apache/conf/php.ini"
Of course, there is a simple way to search through find.
Such as
Find/-name nginx.conf
Find/-name php.ini
Find/-name MY.CNF
Find/-name httpd.conf
This is going to be done by brush.
Original: http://www.phper163.com/archives/368
How to view Nginx, Apache, PHP, MySQL configuration file paths in Linux, if you receive an environment that someone else has configured, but leave no documentation. At this point how to determine the correct load file path is found. You can use the following to determine
1. Judging Apache
First execute the command to find the httpd path
PS aux | grep httpd
If the httpd path is/USR/LOCAL/APACHE/BIN/HTTPD
Then execute the following command
/usr/local/apache/bin/httpd-v | grep "Server_config_file"
To find the configuration file path that was loaded at compile time httpd.conf
The-v parameter can see the parameters that are configured at compile time
2. Judging 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 in the installation directory conf/nginx.conf
3. Judging MySQL
First execute the command to find the MySQL path
PS aux | grep mysqld
If 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 PHP load profile path
(1), can be viewed through PHP function phpinfo, write a file, and then use the URL to access, find "Loaded configuration file" corresponding to the value of the PHP loaded configuration files
(2), if it is a 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 PHP loaded configuration file
(3), if it is a apache+mod_php configuration, you can also view the loaded php.ini path in the Apache configuration file. such as Phpinidir "/usr/local/apache/conf/php.ini"
Of course, there is a simple way to search through find.
Such as
Find/-name nginx.conf
Find/-name php.ini
Find/-name MY.CNF
Find/-name httpd.conf
This is going to be done by brush.