LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-22-2011, 04:30 PM   #1
fhsm
Member
 
Registered: Jan 2009
Posts: 51

Rep: Reputation: 17
Post PHP memory_limit vs. upload_max_filesize


I'm having a very frustrating time getting large uploads working with Debian 6, Apache 2.2, and php 5.3.

As I increase the upload_max_filesize & post_max_size configs at some point all uploads (regardless of size) start to fail silently.

I've got my timeouts set to 600 seconds; I'm not running into timeout problems. I'm setting post_max_size to upload_max + 10mb, which should be more than enough for an otherwise empty upload test form.

It works as expected with 64mb uploads but with 128mb uploads it fails silently.

Should it be theoretically possible for php to accept an upload that is larger than its memory_limit (ie a php process memory_limit of 128mb and upload_max_filesize of 129mb) or does it all need to fit in memory? If it is theoretically possible does anyone else have any insight into making it actually happen?

Thanks.
 
Old 02-22-2011, 07:58 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
What's the free space of the partition in which your apache stores tmp-files?


Cheers,
Tink

Last edited by Tinkster; 02-22-2011 at 08:04 PM.
 
Old 02-23-2011, 09:31 PM   #3
fhsm
Member
 
Registered: Jan 2009
Posts: 51

Original Poster
Rep: Reputation: 17
Current free space on the partition is 492 Gb. An interesting thought but I don't think it's the problem.

To clarify when I increase the upload limit in php.ini *all* uploads, regardless of size, start to fail. When I lower the upload limit in php.ini I'm able to upload files that had previously failed. So for example with upload_max_filesize set to 20mb I can upload a 4mb test file but not a 40mb test file (obvious reasons) with upload_max_filesize set to 80mb I can't upload the 4 or the 40mb test file.
 
Old 02-23-2011, 10:02 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Interesting ... I never heard of this before; a quick google suggests
that the memory_size should be larger than the post_max size which
the drupal guys apparently set to be the same as upload_max_filesize.
 
Old 02-24-2011, 05:49 AM   #5
fhsm
Member
 
Registered: Jan 2009
Posts: 51

Original Poster
Rep: Reputation: 17
This stackoverflow answer references this php source file in claiming that uploaded files are not counted towards the scripts memory_limit.

That said the php docs are (equivocally) in keeping with the Drupal page you linked.

The behavior I'm getting is so hard to nail down that I'm starting to wonder if it's actually a bug...

Any other thoughts?
 
  


Reply

Tags
apache, debian, memory, php, upload


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
upload_max_filesize won't change from default? please help CMaan Linux - Software 4 08-23-2010 06:09 PM
php.ini "upload_max_filesize 2meg" error on large pixel images under 1meg DT (D_Turmined) Linux - Newbie 4 03-25-2009 07:46 AM
memory_limit in php.ini not working yang_wayne Linux - Newbie 1 01-30-2009 05:21 AM
php_value upload_max_filesize 10M tooparam Linux - Newbie 1 02-13-2007 07:12 PM
Memory_limit in php.ini J_Szucs Linux - Software 0 02-07-2005 08:30 AM


All times are GMT -5. The time now is 10:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration