What steps can be taken to ensure that the php.ini file is being read and applied correctly?

To ensure that the php.ini file is being read and applied correctly, you can check the loaded configuration file using the phpinfo() function. Make sure that the php.ini file is located in the correct directory specified in the phpinfo() output. Additionally, you can also try restarting the web server to apply any changes made to the php.ini file.

<?php
// Check the loaded configuration file
phpinfo();
?>