When I execute the bash command php --ini to find the location of the php.ini file, the loaded one is:

Loaded Configuration File:         /etc/php5/cli/php.ini

But when I run a php.info on my webserver, I get this as the loaded one:


What command can I run to return the one associated with Apache?

I remember in CentOS, I could use which php (I think) and that would return it, but using Debian it does not work.


1 Answer 1


The /etc/php5/apache2/php.ini is loaded by default when running under libapache-mod-php5, I am not sure how you can do that from the command line, but you can specify the ini file to be loaded manually using the --php-ini command line option.

For example:

$ php --ini --php-ini /etc/php5/apache2/

However, it seems that even in the above case, the /etc/php5/cli/conf.d is parsed. Apparently, to override that directory, you may need to set it at compile-time, see: https://stackoverflow.com/questions/15183218/php-cli-does-not-use-additional-ini-files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .