User login

Maximum upload size in PHP and Apache

Maximum file size upload problems, please help!!!
http://drupal.org/node/157174

If you have access to php.ini or you are allowed to use a modified copy of php.ini, add two lines like the following at the end (example for 16MB files)

upload_max_filesize = 16M
post_max_size = 18M

If you can't use a php.ini, then you can add two lines in your .htaccess file

php_value upload_max_filesize 16M
php_value post_max_size 18M

[On the Drupal file upload settings page]

you get:
- no more that what upload_max_filesize says
- no more than half of post_max_size
(whichever is smaller)

So, the right numbers for up to 32MB files seem to be:

upload_max_filesize = 32M
post_max_size = 64M

This is just an empirical observation without any knowledge of what is going on. Not sure if it applies always.

CogRusty is wonderful.

See also Agaric's quick and drastic increase of file upload limits in PHP.ini.

Maximum file size upload problems, please help!!!
http://drupal.org/node/157174

If you have access to php.ini or you are allowed to use a modified copy of php.ini, add two lines like the following at the end (example for 16MB files)

upload_max_filesize = 16M
post_max_size = 18M

If you can't use a php.ini, then you can add two lines in your .htaccess file

php_value upload_max_filesize 16M
php_value post_max_size 18M

[On the Drupal file upload settings page]

you get:
- no more that what upload_max_filesize says
- no more than half of post_max_size
(whichever is smaller)

So, the right numbers for up to 32MB files seem to be:

upload_max_filesize = 32M
post_max_size = 64M

This is just an empirical observation without any knowledge of what is going on. Not sure if it applies always.

CogRusty is wonderful.

See also Agaric's quick and drastic increase of file upload limits in PHP.ini.

Comments

Stefan explains how the various places for these settings work

The availability and power of the .htaccess file depends on the Apache
configuration. The directive AllowOverride controls what can be
overwritten in .htaccess files. Some of the configuration directives in
Drupal's .htaccess file also depend on the version of mod_php but we use
FastCGI. As we are using Lighttpd on the test server it does not have
any effect at all.

In the global php.ini one can restrict overriding php config options at
the webserver and application layer. In our configuration their aren't
any restrictions.

I recommend to have all settings in the per site virtual host
configuration.

Also, if you have access to

Also, if you have access to php.ini, find string "upload_max_filesize = 2M" and change value to your own.

Um...

Can I change the MB for Megabyte to GB for Gigabyte?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.