可以使用以下步骤在Linux下查看nginx、apache、mysql和php的编译参数:
查看nginx的编译参数
- 进入nginx的安装目录,在bin下找到可执行文件nginx,使用以下命令获取nginx的编译参数:
/usr/local/nginx/sbin/nginx -V
示例输出:
```
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module
```
- 参数说明:
--prefix=PATH 安装路径
--with-http_ssl_module 开启ssl模块
查看apache的编译参数
- 进入apache的安装目录,在bin下找到可执行文件httpd,使用以下命令获取apache的编译参数:
/usr/local/apache/bin/httpd -V
示例输出:
```
Server version: Apache/2.4.44 (Unix)
Server built: Oct 4 2020 01:25:49
Server's Module Magic Number: 20120211:88
Server loaded: APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="/usr/local/apache/logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
```
- 参数说明:
-D HTTPD_ROOT=PATH 安装路径
查看mysql的编译参数
- 进入mysql的安装目录,在bin下找到可执行文件mysqladmin,使用以下命令获取mysql的编译参数:
/usr/local/mysql/bin/mysqladmin version -p
示范输出:
```
/usr/local/mysql/bin/mysqladmin Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)
Server version 8.0.22
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 1 day 17 hours 45 min 29 sec
Threads: 2 Questions: 7 Slow queries: 0 Opens: 109 Flush tables: 3 Open tables: 102 Queries per second avg: 0.000
```
- 参数说明:
Server version 服务器版本
Protocol version 协议版本
查看php的编译参数
- 进入php的安装目录,在bin下找到可执行文件php,使用以下命令获取php的编译参数:
/usr/local/php/bin/php -i
示范输出:
```
Configuration File (php.ini) Path => /usr/local/php/etc
Loaded Configuration File => /usr/local/php/etc/php.ini
Scan this dir for additional .ini files => /usr/local/php/etc/php.d
Additional .ini files parsed => /usr/local/php/etc/php.d/bcmath.ini,
/usr/local/php/etc/php.d/ctype.ini,
/usr/local/php/etc/php.d/curl.ini,
/usr/local/php/etc/php.d/dom.ini,
/usr/local/php/etc/php.d/exif.ini,
/usr/local/php/etc/php.d/fileinfo.ini,
```
- 参数说明:
Configuration File (php.ini) Path 配置文件路径
Loaded Configuration File 加载的配置文件
Scan this dir for additional .ini files 载入附加的模块配置文件
Additional .ini files parsed 载入的模块配置文件
通过以上步骤,可以方便地查看nginx、apache、mysql和php的编译参数,为后续的调试和优化提供有用的信息。
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Linux下查看nginx apache mysql php的编译参数 - Python技术站