Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I seem to be able to upload small files to DBFM, but when I try and upload a file that is 200KB in size I get the following error message:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 245760 bytes) in /home/vegemite4me/public_html/subdomains/demo/sites/all/modules/dbfm/dbfm.module on line 1465
I am using
DBFM v5.x.3.0
DAPI 5.x.1.0
DBFMgreybox 5.x.1.2
jstools 5.x.0.6
PHP 5.2.5
4.1.22-standard
Line 1465 of dbfm.module is:
$query = sprintf("INSERT INTO dbfm_data (fid, fblob, fmd5, fblobmod) VALUES ('%d', '%s', '%s', '%s')",$newfid, $fblob, $metadata['fmd5'], $currentdate);
Any ideas?
Comments
Comment #1
rooey CreditAttribution: rooey commentedCheck your PHP maximum file size settings!
Comment #2
vegemite4me CreditAttribution: vegemite4me commentedHi rooey, I have the WebFM module installed on the same instance of Drupal, and have no problems uploading 2MB files using WebFM. This implies to me that it is not the PHP max file size settings. (I had to edit .htaccess to add the following in order to upload the files in WebFM: php_value upload_max_filesize 10M and php_value post_max_size 20M.)
Could this be some kind of MySQL filesize/memory restriction??
Comment #3
rooey CreditAttribution: rooey commentedYep - it'll be a mysql thing too - but the fatal error points to a PHP memory size problem - increase those values.
When you upload a file into DBFM it is compressed automatically, so it requires a little extra memory.
Comment #4
rooey CreditAttribution: rooey commentedalso - you REALLY should upgrade to the latest version of DBFM!
Comment #5
geoff_eagles CreditAttribution: geoff_eagles commentedRobin,
I think you're right - I believe it's most likely to be a mysql setting.
Try looking in the mysql my.cnf file and increase all the likely looking settings (I can't remember them offhand but I know that packet size was a factor).
As rooey suggests, I'd be inclined to start with the latest code.
Geoff
Comment #6
geoff_eagles CreditAttribution: geoff_eagles commentedIs this OK now? I'm closing.
Comment #7
vegemite4me CreditAttribution: vegemite4me commentedHi Geoff and Rooey,
Sorry for going quiet. I must also appologies as the version of DBFM is 5.x-3.3. I checked this in dbfm.info.
I have not specificed a my.cnf file (I am using MySQL provided by my hosting company), but by using phpMyAdmin I was able to find the following settings. It seems as though it is the bulk_insert_buffer_size value which has been exeeded, as this number matches the size in the error message.
Can you see anything obvious in these MySQL settings?
Variable Session value / Global value
Comment #8
geoff_eagles CreditAttribution: geoff_eagles commentedThat's confusing. A small file such as yours shouldn't be blocked by the settings you're using. Are you using myISAM tables?
The only setting I'd be inclined to change would be to increase the max allowed packet size.
Comment #9
geoff_eagles CreditAttribution: geoff_eagles commentedGiven the information above I don't think it's a mySQL limitation.
More likely it's your PHP settings although it might also be an apache limitation.
You might find you have more than one php.ini file on your machine e.g one under the php directory and one within the apache directory. Make sure you're editing the active one!.... that's assuming your hosting provider gives you access to such things - otherwise you're buggered.
Comment #10
vegemite4me CreditAttribution: vegemite4me commentedI added the following line to .htaccess, and the issue now seems resolved.
php_value memory_limit 32M
It was exactly what rooey said it was, but it took me a while to realise I could change it.
Thank you for your help!
Comment #11
geoff_eagles CreditAttribution: geoff_eagles commentedGlad it's fixed - extra brownie points to Rooey!