How can the max_execution_time error be resolved when trying to upload a 20mb file using PHP?

The max_execution_time error occurs when the PHP script takes longer to execute than the maximum allowed time set in the php.ini file. To resolve this issue when trying to upload a 20mb file, you can increase the max_execution_time value in the php.ini file or set it dynamically within your PHP script using the set_time_limit function.

// Increase max_execution_time dynamically in PHP script
set_time_limit(300); // Set maximum execution time to 5 minutes (300 seconds)