# I am able to upload a 28 meg file, yet php.ini limits posts to 10 megs. What is up with that?

**URL:** <https://www.ruby-forum.com/t/i-am-able-to-upload-a-28-meg-file-yet-php-ini-limits-posts-to-10-megs-what-is-up-with-that/139130>\
**Category:** Ruby\
**Created:** [May 31, 2008, 4:00am UTC](https://www.ruby-forum.com/t/i-am-able-to-upload-a-28-meg-file-yet-php-ini-limits-posts-to-10-megs-what-is-up-with-that/139130 "2008-05-31T04:00:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lawrence\_Krubner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aeb1de/32.png) [@Lawrence\_Krubner](https://www.ruby-forum.com/u/Lawrence_Krubner)\
**Post date:** [May 31, 2008, 4:00am UTC](https://www.ruby-forum.com/t/i-am-able-to-upload-a-28-meg-file-yet-php-ini-limits-posts-to-10-megs-what-is-up-with-that/139130/1 "2008-05-31T04:00:55Z")

</div>

To guard against users uploading huge files, I’ve got this in my php.ini  
file:

; Maximum size of POST data that PHP will accept.  
post\_max\_size = 10M

On a server running Ubuntu Linux. The PHP version:

root@ldc310:/etc/php5/cli# php -v  
PHP 5.1.6 (cli) (built: Nov 28 2007 22:52:49)

I just uploaded a 28 meg file to the server. I have a PHP script that  
automatically resizes the images to less than a meg. However, I was  
(hoping) assuming that the upload should have failed, before the PHP  
script ever had the chance to resize the file. How do I limit how much  
our users can upload? I really don’t want the users to have the power to  
upload 30 or 40 or 50 meg files.

The server does have Plesk installed, which I know, in times past, has  
found ways to undermine the settings in php.ini. For instance, for  
open\_basedir, the value that gets written in the httpd.conf file, in  
each vhost directory, takes precedence over whatever I put in php.ini.  
But I’ve never seen Plesk undermine the importance of the post\_max\_size  
setting, nor can I imagine where Plesk might store such a conf setting  
if it did.

Any thoughts on what might be wrong? Are there other places some  
configuration data might be taking precedent?

---

<div class="post-metadata">

**Author:** ![Lawrence\_Krubner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/aeb1de/32.png) [@Lawrence\_Krubner](https://www.ruby-forum.com/u/Lawrence_Krubner)\
**Post date:** [May 31, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/i-am-able-to-upload-a-28-meg-file-yet-php-ini-limits-posts-to-10-megs-what-is-up-with-that/139130/2 "2008-05-31T16:52:11Z")

</div>

Bad list man :). It’s ruby, not php.

–  
Rados³aw Bu³at

[http://radarek.jogger.pl](http://radarek.jogger.pl) - mój blog
