PHP configuration files are not located in the same place in all operating systems variants. Therefore for you to know where your specific configuration is located, we have provided this little guide featuring the major operating systems and distros.
First off you can run
php -i from the command-line on Windows or terminal on Unix systems. This will display a lot of information about your particular setup. Next, you need to look for the value of the
Loaded Configuration File.
Here is a quick example of Unix-based systems.
$ php -i | grep 'Loaded Configuration File' Loaded Configuration File => /etc/php.ini
Here are the general locations of the
php.ini PHP configuration files.
Ubuntu < 16.10
Ubuntu >= 16.10
Ubuntu >= 18.04