The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
is there a limit to post_max_size?
Discuss is there a limit to post_max_size? in the PHP Development forum on Dev Shed. is there a limit to post_max_size? PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 31st, 2002, 11:29 AM
|
 |
Charge into the Knight
|
|
Join Date: Jan 2002
Location: Orlando, FL
Posts: 276
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
is there a limit to post_max_size?
1.) Is there a limit on post_max_size?
2.) How about upload_max_filesize?
3.) The manual mentioned something about memory_limit has to be bigger then post_max_size. I can't seem to find "memory_limit" in my phpinfo.php page. Am I blind?
__________________
Every man is a fool for at least five minutes every day; wisdom consists of not exceeding the limit.-- Elbert Hubbard
|

October 31st, 2002, 11:37 AM
|
|
Always Learning
|
|
Join Date: Oct 2002
Location: Port Neches, TX, USA
Posts: 1,173
  
Time spent in forums: 3 Days 7 h 45 m 43 sec
Reputation Power: 15
|
|
|
your max upload size is set in php.ini, and it has to be smaller than the amount of ram your computer has available; that's typically no more than 50% of your total ram. why would you want to upload such mammoth files through php?
__________________
David Fells
If my post helped you, please click the  above my post and leave a comment. Thanks
|

October 31st, 2002, 12:34 PM
|
 |
Charge into the Knight
|
|
Join Date: Jan 2002
Location: Orlando, FL
Posts: 276
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
I was just curious.
Is there a way to error trap for post_max_size? Say a user uplaods 11 MB and my post_max_szie is set to 8MB. Right now all I get is a Can not find page error.
|

October 31st, 2002, 01:21 PM
|
 |
Contributing User
|
|
Join Date: Apr 2001
Posts: 645
Time spent in forums: 16 sec
Reputation Power: 0
|
|
|
usually it is set in the form as max_file_size as a hidden input. that way you can check when the file gets uploaded.
by default php is set to 2M.
all you have to do is check the max_file_size against the filesize
something like this
$filesize=filesize($_FILES['fileupload']['name']);
if ($max_file_size!=0 and $filesize>$max_file_size) {
display to big message here.
}
|

October 31st, 2002, 03:03 PM
|
 |
Charge into the Knight
|
|
Join Date: Jan 2002
Location: Orlando, FL
Posts: 276
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
|
Thanks
|

November 1st, 2002, 03:08 AM
|
 |
Contributing User
|
|
Join Date: Apr 2001
Location: The Netherlands
Posts: 328
Time spent in forums: 19 m 41 sec
Reputation Power: 13
|
|
|
It's easy to change in php.ini. However, most people can't edit their php.ini (because their site is hosted and the hosting company won't allow it).
An easy way to get arround this if the following .htaccess file:
php_value post_max_size 1000M
php_value upload_max_filesize 1000M
Maybe this is a little bit off topic and obsolete for most of you PHP guru's, but I want to inform all other newbies (like me).
Good luck, Filip
|

December 1st, 2003, 06:43 AM
|
 |
Web Developer
|
|
Join Date: Oct 2001
Location: Finland
Posts: 719
  
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 14
|
|
Quote: Originally posted by bizzk
IAn easy way to get arround this if the following .htaccess file:
php_value post_max_size 1000M
php_value upload_max_filesize 1000M |
Well, now that we're on the topic, could you tell me why this doesn't work for me? I use, the almost exact same, except they are in my virtual host, like so:
Code:
<VirtualHost 127.0.0.1>
ServerName www.okartek.lin
ServerAdmin webmaster@datamike.org
DocumentRoot "/var/www/html/okartek/pankki"
Alias /images "/var/www/html/okartek/images"
Errorlog /var/www/html/okartek/logs/error_log
php_value upload_tmp_dir /var/www/html/okartek/filebank
php_value post_max_size 500M
php_value upload_max_filesize 500M
</VirtualHost>
When i check my phpinfo page, it only uses one of the php_value directives, namely the upload_max_filesize and sets it neatly to 500M. But both upload_tmp_dir and post_max_size directives are not uploaded. Apache is restarted normally, without any hint in start up or in the logs.
If I use these same values in php.ini everything is fine, but in the Virtual Host, they don't work. I'm a little lost. Any ideas?
__________________
-- Tomi Kaistila
-- Developer's Journal
The more you learn, the more you know.
The more you know, the more you forget.
The more you forget, the less you know.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|