where is php.ini on ubuntu?

On Ubuntu, the location of the php.ini file depends on the version of PHP you have installed.

For PHP 7.4 and later, the file is located at /etc/php/7.4/cli/php.ini for the command line interface and /etc/php/7.4/fpm/php.ini for the FPM/FastCGI version.

Watch a course Learn object oriented PHP

For PHP 5.x, the file is located at /etc/php5/cli/php.ini for the command line interface and /etc/php5/fpm/php.ini for the FPM/FastCGI version.

You can also use the following command to locate the php.ini file:

sudo find / -name php.ini 2>/dev/null