User login

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

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 2 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!

Comments

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)

Help regarding PHP larger file uploading

I'm facing this problem and resolve the issue by changing

post_max_size,upload_max_filesize

but I want the solution to upload large file like 200MB on my web server with my c++ client appliction without having any dependency on these application settings.

Please any help..

Same ... with uploadify

This night have installed vps, lamp + setup there own ajaxed script. Also - uploadify stop works with large files (~8mb and nothing more). So just i increase post_ size and now all ok.

Thank your for article, help very.

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.