Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have currently 3 php.iniS files in my /etc/php5 path. tree:


but I still feel that there is something wrong. I tried to make some syntax errors in all php.ini files, tried to restart apache and it restarted successfully. What's wrong? How do I get path to REAL php.ini I should edit to be able to see changes?

share|improve this question
up vote 6 down vote accepted

For the web, create a simple php page that has the following


It will show all the ini files parsed

share|improve this answer

From your command line, just run php --ini:

[sandro@mercury ~]$ php --ini
Configuration File (php.ini) Path: /usr/local/etc
Loaded Configuration File:         /usr/local/etc/php.ini
Scan for additional .ini files in: /usr/local/etc/php
Additional .ini files parsed:      /usr/local/etc/php/extensions.ini
share|improve this answer
and when I use cli, does it apply to browser (apache) access, too ? – genesis Jul 27 '11 at 13:49
Unless you've managed to setup multiple php's on the same server running your apache server, yes. I actually had to setup a server using php4 and php5 years ago, and it's a glorious pain. You'd have run into this question far sooner if you had such a setup ;) edit: sreimer's answer is probably best to know for certain what the server's referencing as far as your php install is concerned – sandroid Jul 27 '11 at 14:00

You can check it with:

# php -i | grep "php.ini"
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.