3

I wanted a clean reinstall of php5-cli, php5-common, php5-fpm. So what I did was:

rm -rf /etc/php5
rm -rf /usr/local/lib/php5
rm -rf /usr/local/php5
rm -rf /usr/lib/php
apt-get autoremove php5*
apt-get purge php5*

But after reinstalling I don't have /etc/php5/cli/php.ini or /etc/php5/fpm/php.ini anymore. How could I get them back?

My install command:

apt-get install php5-cli php5-comon php5-cli --force-yes -o Dpkg::Options::=--force-confmiss

Jürgen Paul
  • 1,225
  • 4
  • 14
  • 21

1 Answers1

4

First you need to do complete removal of packages using this command.

sudo apt-get purge php*

Now install again using

sudo apt-get install php* 

You will get generated new config files.

KK Patel
  • 385
  • 4
  • 17
  • 1
    I'm not sure this is a good idea – Jacek Pietal Jun 06 '15 at 21:32
  • ✅ **It is a good idea**. If you're afraid, maybe you should use server provisioning tools or virtual machines to test commands. `sudo apt-get purge` will remove configurations and next time you install them, default configurations will be created again. Have a look to this great answer if in doubt: https://askubuntu.com/a/187891/172828 The bad idea here is not the `purge` command, it's the part where the *user manually deleted folders* instead of *using the tools provided by the package manager*. – GabLeRoux Jun 11 '17 at 05:00