What role does the php.ini file play in configuring PHP settings for different hosting environments?

The php.ini file is a configuration file that allows users to customize various settings for their PHP environment, such as memory limits, file upload sizes, error reporting levels, and more. This file plays a crucial role in configuring PHP settings for different hosting environments as it allows users to tailor PHP to meet the specific requirements of their website or application.

// Example of changing the memory_limit setting in php.ini
ini_set('memory_limit', '256M');