Agaric Design Collective

Increasing PHP file upload limits... capabilities is another matter

 
By Benjamin Melançon
on 07 Aug
1 comment

Upping PHP's maximum file size upload limit:

Your problem: the file upload settings page on your Drupal site (if you've found it) is telling you silly PHP won't let people upload big files, to wit:

Your PHP settings limit the maximum file size per upload to 200 MB.

There's two places that this has to change in your php.ini file; this can also be set in your settings.php PHP initialization variables.

We at Agaric like the sledgehammer - nay, mechanized battering ram - approach to fixing niggling little problems, so here's what we're going to make those sections look like:

; Maximum allowed size for uploaded files.
upload_max_filesize = 200M

and

; Maximum size of POST data that PHP will accept.
post_max_size = 400M

Here's what you have to do in command line shell commands, which is sort of like poetry...

locate php.ini
vi /etc/php5/apache2/php.ini
/upload
i

cursor keys cursor keys...
00
esc
/post_max

cursor keys cursor keys... backspace
400
esc
shift-ZZ
(which saves and exits from the vi text editor)
apache2ctl restart
(which restarts Apache, in our configuration, which, you'll note, is Apache 2.)

Now go to admin/settings/uploads ...

Your PHP settings limit the maximum file size per upload to 200 MB.

That's more like it!

The Agaric way is not recommended for mortals, sane people, or even deities or insane people with weak stomachs.

Agaric already covered this subject on this page but here we cut to the chase!

 

You will probably (a) not

You will probably (a) not want to use such insanely large limits and (b) want to make sure you also have memory settings higher than the default, also in php.ini. The increases here are comparatively modest. Note also that upload size isn't the same as the resource limits here, but timeout in particular may need to be increased a lot for larger uploads.

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 100 ; Maximum amount of time each script may spend parsing request data
memory_limit = 64M ; Maximum amount of memory a script may consume (16MB)

Posted by Benjamin Melançon on Wed, 2007-10-03 07:52
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.