Where does the /etc/php/7.0/apache2/php.ini file come from on Ubuntu 16.04?
dpkg -S /etc/php/7.0/apache2/php.ini
returns nothing.
dpkg -S /etc/php/7.0/apache2/
shows that the directory is installed by the libapache2-mod-php7.0 package, but
dpkg-query -L libapache2-mod-php7.0
does not mention "php.ini". I'm guessing that this file is copied during a postinstall process. Is there a way to determine which package installation is creating this file?
Best Answer
When you are searching for the how something got on your system often you might just want to try a command like this
grep 'php.ini' /var/lib/dpkg/info/*
. The/var/lib/dpkg/info/
contains files related to packages, which include thepackagename.list
which is used by the dpkg -S, thepackagename.conffiles
which is a list of the conffiles, and the files for the various pre/post install/remove scripts likepackagename.actionname
.Anyway for this particular query we see that the php.ini is being added via ucf from
/usr/lib/php/7.0/php.ini-production
. UCF is one of a few tools that can be used by Debian packages to maintain configuration files. UCF can accept some values from users to be merged in, it can detect and auto-update or merge configurations in some situations and so on.