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

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

./php5_
./php5_/cli
./php5_/cli/conf.d
./php5_/cli/php.ini
./php5_/apache2
./php5_/apache2/conf.d
./php5_/apache2/php.ini
./php5_/conf.d
./php5_/conf.d/suhosin.ini
./php5_/conf.d/mysql.ini
./php5_/conf.d/mysqli.ini
./php5_/conf.d/gd.ini
./php5_/conf.d/pdo.ini
./php5_/conf.d/mcrypt.ini
./php5_/conf.d/curl.ini
./php5_/conf.d/pdo_mysql.ini
./cli
./cli/conf.d
./cli/php.ini
./apache2
./apache2/conf.d
./apache2/php.ini
./conf.d
./conf.d/memcache.ini
./conf.d/suhosin.ini
./conf.d/mysql.ini
./conf.d/mysqli.ini
./conf.d/gd.ini
./conf.d/pdo.ini
./conf.d/mcrypt.ini
./conf.d/memcached.ini
./conf.d/curl.ini
./conf.d/pdo_mysql.ini

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

3 Answers 3

up vote 5 down vote accepted

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

    <?php
    phpinfo();
    ?>

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
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 '11 at 14:00

You can check it with:

# php -i | grep "php.ini"
share|improve this answer

Your Answer

 
discard

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.