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!
This is a classic way to locate httpd.conf file:
# find / -name 'httpd.conf' -print
Also you can file locate the file using
locate httpd.conf
httpd -V
It will shows all compile settings, in the middle of the results you will find:
/usr/local/apache
conf/httpd.conf
Apache conf file:
/usr/local/apache/conf/httpd.conf
root@host [~]# httpd -V
Server version: Apache/2.4.16 (Unix)
Server built: Dec 15 2015 10:01:02
Cpanel::Easy::Apache v3.32.6 rev9999
Server's Module Magic Number: ...
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
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="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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With