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?

3 Answers 3


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


It will show all the ini files parsed


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
  • 1
    and when I use cli, does it apply to browser (apache) access, too ?
    – genesis
    Jul 27, 2011 at 13:49
  • 1
    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, 2011 at 14:00

You can check it with:

# php -i | grep "php.ini"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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