View Issue Details

IDProjectCategoryView StatusLast Update
0003702mantisbtbugtrackerpublic2010-04-23 23:22
Reporterpangea Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Summary0003702: problem in uploading big file
Description

No matter How I change the size of those variables necessary including PHP.ini my.cnf httpd.conf.
The following messages always appear.

//
Fatal error: Allowed memory size of 31457280 bytes exhausted (tried to allocate 49283335 bytes)
in /usr/local/www/data-dist/mantis/core/database_api.php on line 225
//

What should I do for solving this problem ?
It happen in uploading big file (bigger than 20MB).
Thanks for your help.

regard,

tlyao

TagsNo tags attached.

Relationships

has duplicate 0004766 closedgrangeway Uploading a file that is too large results in an Upload Failed error 
related to 0005369 closedthraxisp application error #15 with uploading bmp file bigger than 1mb 

Activities

jlatour

jlatour

2004-03-31 07:30

reporter   ~0005303

Have you tried using files as attachment storage (instead of database, as is the default, see config_defaults.php)? I don't know about any memory limit that you can change, but if there is any, it should be in php.ini.

pangea

pangea

2004-04-02 05:08

reporter   ~0005325

YA,I have changed every necessary varibles including php.ini .
But,it still can't work.

Apel

Apel

2004-04-02 06:39

reporter   ~0005328

there's a memory limit in php.ini (30MB in your case):
http://www.php.net/manual/en/configuration.directives.php#ini.memory-limit
and you need to set it to fit the largest upload you want plus some safeguard for the rest of the script.

hacker

hacker

2004-04-03 08:25

reporter   ~0005333

I ran into this yesterday, and solved it by changing a few values:

In the default Red Hat apache I was using for this client, I noticed the following structure in their httpd.conf:

<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP

LimitRequestBody 524288

</Files>

I commented that last line out. Originally, I was getting a 'Document contains no data' message. Once I fixed that, I got further. But not quite...

In php.ini, there is also a few things that need to be adjusted:

If your file is LARGE, make sure to check 'max_execution_time', 'max_input_time', and 'memory_limit'. Increase them as necessary. Also make sure 'file_uploads' is set to "On".

That then allowed me to get the file into Mantis, but then it crashed with the following error:

'Database query failed. Error received from database was 0002006: MySQL server has gone away for the query: INSERT INTO mantis_bug_file_table'

This was solved by putting the following in my /etc/my.cnf (MySQL global confiuration file)

max_allowed_packet = 8M

Then I could upload the file into the system. So the order is:

Make sure Apache allows a POST size that permits your file to be accepted (LimitRequestBody).

Make sure PHP has enough memory to handle parsing the file (memory_limit).

And make sure MySQL (if using that) has a large enough "bite" to accept the blob (max_allowed_packet)

Hopefully this helps.

schickb

schickb

2004-11-10 01:36

reporter   ~0008315

I just hit a similar issue in Mantis 0.19.0

When I tried to upload a 2.2MB file I got a similar error. I had to boost the "memory_limit" value in php.ini from 8MB all the way to 16MB to fix the problem. That is a large boost for a 2.2MB file, and it made me think that mantis is not allocating memory efficiently when using the DATABASE upload storage method.

I switched to FILE uploads in config_defaults.php and was then able to change the php "memory_limit" back to 8M. Maybe its the Mysql driver code and not Mantis, but it's worth looking into (I'll do it if I get time).