There are 3 configuration options that affects file uploading in php, all of them in php.ini, and some of them configurable at runtime.
You should take care of:
**max_input_time** its the time a script could invest in parsing the input
**file_uploads should** be set to on, it determines if uploads are allowed at all or not
**upload_max_filesize** is the maximum size for the uploaded files
**post_max_size** since uploads are inside POST requests, you should raise this value at least to the value you specified in upload_max_filesize
After you change this settings in php.ini, remember to restart apache.
It is also adviced to remove the max execution time limitation with:
set_time_limit(0); at code level.
Aside from that, remember that if you upload large files, you should never put the content of the files directly inside a variable, you would run out of memory if you do it.