Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I found this page: http://www.php.net/manual/en/configuration.file.php. On my OS: Fedora 17, Apache 2.2,PHP 5.4 I searched for PHPIniDir in the httpd.conf file. This configuration does not exists.

How does Apache knows where is the php.ini then ? ( /etc/php.ini)

share|improve this question
why the downvotes ? –  user56379 Feb 1 '13 at 21:46

2 Answers 2

up vote 2 down vote accepted

Compile time defaults exist as a fail-safe when certain directives are not specified. In this case the PHP module "knows" where to look for php.ini if no directive is found because it is programmed and compiled in such a way.

share|improve this answer
so it will look directly for /etc/php.ini ? –  user56379 Feb 1 '13 at 21:51
Most likely. It is a compile time option. strings libphp5.so | grep \/etc/ will give you hints about the basedir where it expects to find php.ini in. –  adamo Feb 1 '13 at 22:04
found it, perfect –  user56379 Feb 1 '13 at 22:06

It is php that actually knows where the the php.ini file. This information is most likely incorporated into the PHP Apache module which either is generated by the PHP release or the PHP package is used during apache compilation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.