I have a web application that allows users to upload some pictures from their computer... usually 5-10 pictures max. With the advent of larger megapixel cameras that produce pictures 10+ megabytes, teamed with internet users who don't know how to resample down an image or just plain don't want to... I need to accomodate such large uploads and hence my current PHP Max Post Size limit and Max Upload Size limit aren't high enough.
My question is... Is it relatively safe to increase the Max Post Size to say 100 mb and increase the max upload size to say 80 mb? This is much more than my current 16mb and 4mb respectively. Or should I just increase the limits and not think twice? Thanks for your valued opinions. Take care.
Max Post Size & Max Upload Size
Moderator: General Moderators
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
Hey feyd... I have a dedicated 3.2 ghz Pentium 4 server with 2 GB Ram. After much more research it seems that the biggest problem with increasing these limits is not so much security issues as it is memory issues, as it seems that if say 5+ concurrent users upload big files at the same time, those files must be stored in php's memory and could essentially eat up a chunk of my RAM and slow the other parts of my server, correct?
So with that being said, and with my server specs... in your humble and professional opinion, would you have any heartache with upping max_post_size and max upload size to say 75 and 85 mb respectively? I know very little about how servers perform under different conditions... especially since I will be using GD to resample down the size of the images and also create thumbnails of each. Thanks again for your help and professional advice.
So with that being said, and with my server specs... in your humble and professional opinion, would you have any heartache with upping max_post_size and max upload size to say 75 and 85 mb respectively? I know very little about how servers perform under different conditions... especially since I will be using GD to resample down the size of the images and also create thumbnails of each. Thanks again for your help and professional advice.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The uploading process doesn't eat much, if any memory in PHP. It's GD that will eat all the memory.
My personal setups usually have the sizes set to 1GB or more, quite often.
Just remember that GD will use roughly $size bytes of memory for any given image resource
My personal setups usually have the sizes set to 1GB or more, quite often.
Just remember that GD will use roughly $size bytes of memory for any given image resource
Code: Select all
$width = ($imagePixelWidth + 3);
$width -= $width % 4;
$size = $imagePixelHeight * $width * 4;- seodevhead
- Forum Regular
- Posts: 705
- Joined: Sat Oct 08, 2005 8:18 pm
- Location: Windermere, FL
When you say this... do you mean you set your max post size and max upload size to 1GB+ or are you referring to something else. So it sounds like in your opinion I am good to go ahead and increase my limits to approx 75-100mb with my server specs?feyd wrote:My personal setups usually have the sizes set to 1GB or more, quite often.
Also, would it be wiser to just change these php config settings using .htaccess in the web applications folder, as opposed to a "global" config change in the php.ini? Thanks for your input feyd... glad to have a pro like you around!
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The directives.seodevhead wrote:When you say this... do you mean you set your max post size and max upload size to 1GB+ or are you referring to something else.
The server shouldn't bat much of an eye at it unless you have hundreds of concurrent sessions resizing images. Even then, the CPU will be hit more than the memory.seodevhead wrote:So it sounds like in your opinion I am good to go ahead and increase my limits to approx 75-100mb with my server specs?
I'll often do it per directory for the larger sizes.seodevhead wrote:Also, would it be wiser to just change these php config settings using .htaccess in the web applications folder, as opposed to a "global" config change in the php.ini?
I'm glad and honored people appreciate my opinion.seodevhead wrote:Thanks for your input feyd... glad to have a pro like you around!