Make a phpinfo.php file using the code below:
<?php phpinfo(); ?>
And open it in your browser. In the "Loaded Configuration File" part, the path to the configuration file used, usually php.ini will appear. Of course, if it is not shared hosting and you have access to change it.
You can also create a php.ini file at the root of your project.
In php.ini, change the part:
upload_max_filesize: (maximum upload size)
post_max_size: (maximum size of posted data, but also affects file upload)
memory_limit: (maximum amount of memory, in bytes, that the script can allocate. This must be greater than "post_max_size")
max_execution_time: (Maximum execution time)
When loading large files, it is important not to leave a very short time, as errors may occur if you do not have time to send the entire file.
Also note if the user has access to write to the directory where the uploaded file will be saved.
References:
link