I am trying to increase the upload_max_filesize in the remote linux server with the help of .htaccess file.It worked and I increased it to 4M but while I tried to upload a file of 3.2MB the page expired.
I have increased the max_execution_time to 300 seconds but still not getting the problem solved.
Could be a timeout issue with either PHP or Apache.
I believe both have settings, and it sounds like you've set the PHP one to 5 minutes (max_execution_time 300).
Try using the function set_time_limit(int seconds) in your PHP as well and see if that'll extend it. 5 minutes is a long time to wait for a file upload though...
Check your apache for the following : LimitRequestBody <value>
This will restrict uploaded content to a certain size from a single connection request.
Also check the TimeOut directive in Apache. You may find it limited to 60 seconds or slightly more (not enough). Make this large for larger file uploads.
Are you trying to upload multiple files at once or just the one?
Have you had success with smaller files?
Is there a restriction on the filesize for tmp files? i.e. are you reaching a space quota?