php upload file

I am trying to upload large files 22 meg.
I can do it with small files.
I found something that said put these lines at the top of my script:
ini_set("upload_max_filesize","50M"); //maximum of 50 MB
ini_set("max_execution_time",0); //Unlimited timeout

It did not work.  My page loads for a while, then it says can't find server.
jackjohnson44Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ch2Connect With a Mentor Commented:
You can change those settings but if your script runs more time than the set in Timeout option in httpd.conf will stop uploading and throw a connection timeout (can't find the server).
0
 
ch2Commented:
Related Configurations Note:  See also the file_uploads, upload_max_filesize, upload_tmp_dir, post_max_size and max_input_time directives in php.ini  

http://es2.php.net/features.file-upload

0
 
ch2Commented:
Try to change

upload_max_filesize = 22M
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jackjohnson44Author Commented:
I changed the settings above and it did not help.
This article confuses me, I did not see a solution.
0
 
ch2Commented:
sorry, try this

post_max_size = 22M
0
 
ch2Commented:
So you have to change the time-out of your webserver i guess.
0
 
_delasCommented:
ini_set ("post_max_size", "22M");
ini_set ("max_input_time", nums_of_secs);

also memory_limit can influence the file limit dimension
0
 
jackjohnson44Author Commented:
if I set max input time to 0, will it be unlimited like max execution time?
0
 
_delasCommented:
0
 
Aamir SaeedCommented:
if you want that your script dont give the error of maximum execution error and so then you can use
set_time_limit(0);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.