Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

On my development machine I run Ubuntu 10.04.1 LTS. Following the official documentation, I used the following command to install Apache, MySQL and PHP in one go:

sudo tasksel install lamp-server

Now that I'm testing my PHP scripts, I want to enable "developer mode", if there is one, to enable error reporting and logging. I have read reference to files php.ini-production and php.ini-development that apparently come with some versions of PHP 5, but not the one I have installed.

All I have is /etc/php5/apache2/php.ini. This configuration does not echo errors or warnings, which makes my scripts hard to debug. I guess I can edit the configuration by hand, but I'd rather just be able to drop in a replacement if that's possible.

So what I'm looking for is an easy way to switch between development and production environments for PHP!

share|improve this question
up vote 11 down vote accepted

php.ini-development and php.ini-production, which come with the PHP 5.3 package, are really just examples of recommended settings. You should review the settings and make sure that they apply to your use and copy them to the regular php.ini file location. On my Ubuntu 10.04.1 LTS (lucid) server, here’s where I find mine:

# locate php.ini-development
/usr/share/doc/php5-common/examples/php.ini-development

The alternative example, php.ini-production, is in the same directory.

share|improve this answer
    
Thank you! I found mine here as well. – Iain Elder Sep 5 '10 at 17:06

php.ini-development file for php7 on ubuntu 16.04 is located in

/usr/lib/php/7.0/php.ini-development

So you can do the following: make backup copy of your current php.ini:

$ sudo mv /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.back

then copy production ini file:

$ sudo cp /usr/lib/php/7.0/php.ini-development /etc/php/7.0/apache2/php.ini

and restart the server:

$ sudo service apache2 restart
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.