我怎样才能找出httpd.conf文件所在?

编程入门 行业动态 更新时间:2024-10-27 16:32:58
本文介绍了我怎样才能找出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文件所在?

本文发布于:2023-07-16 04:05:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117670.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   httpd   conf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!