What role does the post_max_size parameter play in setting file upload limits in PHP, and how does it affect overall upload capabilities?

The post_max_size parameter in PHP determines the maximum size of POST data that PHP will accept. This parameter also affects file uploads because file uploads are considered as part of the POST data. If the file being uploaded exceeds the post_max_size limit, the upload will fail. To increase the file upload limit, the post_max_size parameter needs to be adjusted in the php.ini file.

// Increase file upload limit by setting post_max_size in php.ini
// php.ini file should be edited to set post_max_size to desired value

ini_set('post_max_size', '20M');