Why do phpinfo() and the php command show different .ini file paths? -
i have spend time trying figure out why setting php.ini
wasn't correctly loading, when know sure have changed in file.
after trying out old <?php phpinfo(); ?>
code through php file, opposed reading output php -i
command in console, turns out paths different.
phpinfo()
output:
+------------------------------------+--------------------------------+ + configuration file (php.ini) path + /etc/php5/apache2 + +------------------------------------+--------------------------------+ + loaded configuration file + /etc/php5/apache2/php.ini + +------------------------------------+--------------------------------+
php -i | grep "php.ini"
output:
configuration file (php.ini) path => /etc/php5/cli loaded configuration file => /etc/php5/cli/php.ini
but why happen, why there 2 configurations, , why these 2 environments using separate ones? also, shouldn't php
command same 1 apache2 using when executes scripts, , therefore load same ini
file when being executed console?
Comments
Post a Comment