@xxoulmate
When you say, "error occurs", which error is it? Is it one of your errors or a PHP error? If it's a PHP error, please let us know exactly what it says.
Does "got here" get displayed ever?
I think that it's simply timing out. Have you increased your max execution time in your php.ini? What I think is happening is: When someone uploads something <5MB, the form is submitted with that file and then the file is analysed and rejected for being too big. When it is >5MB the form is not submitted because PHP times out before it can upload the whole file and send the form.
With PHP timeout, if a script is taking longer than x seconds, it will can it, and this is a security thing, so it's not good to set it too high or remove it incase someone who wanted to do you harm (or were just ignorant), blocks up your server with ridiculous requests which take forever to process.