COMMAND to find where php.ini location:
$ php --ini

OUTPUT:
$ php --ini
Configuration File (php.ini) Path:
Loaded Configuration File: G:\xampp8\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)

if you are reading this its probably because you are like me. i wanted to know where i can find the php.ini file. i needed to know because i need to make some configuration changes to my PHP and i have a linux Centos (its basically the same as fedora or redhat) there two ways of finding out.
For PHP8, you might find it at:
/etc/php/8.1/fpm/php.ini

1. by default, the php.ini file is located at: /etc/php.ini

2. if for some reason its not in the /etc/ directory in your system, you can still find out where the php.ini file is located at. simply by running a phpinfo.php file in your system. basically create a php file and put this function in it:

<?php
echo phpinfo.php();
?>


hope that helps