Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Why exist in Ubuntu lamp 2 PHP.ini files, and what function they doing?

  1. /etc/PHP5/cli/PHP.ini

  2. /etc/PHP5/apache2/PHP.ini

share|improve this question
up vote 1 down vote accepted

The first file, /etc/php5/cli/php.ini, is the PHP configuration file (php.ini) for when the console command php is run. The second file, /etc/php5/apache2/php.ini, is the PHP configuration file for when PHP is run as an Apache extension. If you're trying to use a php.ini for your website, use the second location.

share|improve this answer

PHP can be executed from the command line or from a webserver. /etc/php5/apache2/php.ini is used for the webserver execution, /etc/php5/cli/php.ini is used for the command line execution.

share|improve this answer
beat me to it by 39 seconds D: – squircle Jun 1 '10 at 19:10
Ye I'm so sorry! XD But we're both right! :D – BloodPhilia Jun 1 '10 at 19:11
Thank you very much! – Yosef Jun 1 '10 at 19:56

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.