我怎样才能找出httpd.conf文件所在? [英] How can I find out where the httpd.conf file is located?

查看:1858
本文介绍了我怎样才能找出httpd.conf文件所在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能找出httpd.conf文件在Apache(PHP)的路径?我不知道是不是我的脚本将在Windows下的Apache或Linux上拼命地跑,我需要知道在哪里可以以从那里找到一个参数,找到该文件。谢谢!

How can I find out the path of the httpd.conf file on apache (PHP)? I do not know whether my script will be runned in windows apache or linux, i need to know where i can find this file in order to find a parameter from there. thanks!

推荐答案

我认为它不会暴露PHP。
运行的httpd -V 终端,你会发现它在那里(命令名称取决于你的系统/ Apache的版本,它也可以阿帕奇-V

I think its not exposed to PHP. Run httpd -V in terminal and you will find it there (command name depends on your system/apache version, it can be also apache -V):

bash-3.2# httpd -V
Server version: Apache/2.2.22 (Unix)
Server built:   Aug 24 2012 17:16:58
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_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=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"     <-- HERE IT IS

但如果你只是想知道一些配置变量的值,那么的phpinfo()的getenv() apache_getenv()应该是足够

这篇关于我怎样才能找出httpd.conf文件所在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆