How can one determine which php.ini file is being used in a PHP setup?

To determine which php.ini file is being used in a PHP setup, you can create a PHP script that uses the phpinfo() function to display all the configuration settings, including the path to the php.ini file. This will help you identify the exact php.ini file being used by your PHP installation.

<?php
phpinfo();
?>