本文介绍了我怎样才能找出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文件所在?
发布评论