What are the best practices for setting PHP configuration values for file uploads?

When dealing with file uploads in PHP, it is important to configure certain PHP settings to ensure security and proper functionality. Some best practices for setting PHP configuration values for file uploads include setting appropriate values for upload_max_filesize, post_max_size, and max_file_uploads in php.ini, as well as ensuring proper error handling for file uploads.

// Set PHP configuration values for file uploads
ini_set('upload_max_filesize', '20M');
ini_set('post_max_size', '25M');
ini_set('max_file_uploads', '5');