How does PHP determine which ini file to use when configuring settings with `ini_set`?

PHP determines which ini file to use when configuring settings with `ini_set` based on the order of precedence defined in the PHP configuration. By default, PHP looks for the php.ini file in the following locations: the directory where PHP is installed, the Windows directory, and the system directory. To ensure that the correct ini file is used, you can specify the path to the desired ini file using the `PHPIniDir` directive in your web server configuration.

// Specify the path to the desired php.ini file in your web server configuration
ini_set('PHPIniDir', '/path/to/php.ini');

// Set configuration settings using ini_set
ini_set('setting_name', 'value');