Link to home
Start Free TrialLog in
Avatar of mrgordonz
mrgordonzFlag for Australia

asked on

Large file uploads with PHP application

Hi Experts,

I run a small helpdesk service for my clients using a PHP help desk application called HelpSpot (http://www.helpspot.com).  It works very nicely and I rarely have any issues.  I am trying to configure the server to allow large files to be attached (ie: uploaded) to cases/requests.  HelpSpot has some guidelines on enabling large file uploads here: http://www.helpspot.com/helpdesk/index.php?pg=kb.page&id=34.  Based on their guidelines as well as other information I have found on the web, my PHP settings are as follows:

file_uploads = On
upload_tmp_dir = /tmp
upload_max_filesize = 10M
post_max_size = 20M
memory_limit = 128M
max_input_time = 360
max_execution_time = 360

In the MySQL config, max_allowed_packet is set to 33554432 (32 MB).

The problem is that I can successfully attach a 2 MB file to a case but I can't attach anything larger than 2 MB.  

I should mention that when a file is attached to a case it is not saved on the file system - it is saved in the MySQL database as a BLOB.  Also, the server OS is Ubuntu Server 8.04 LTS, and the versions of the various servers/packages are:

Apache:  2.2.8
PHP:  5.2.4-2ubuntu5.9
MySQL:  5.0.51

I have two questions:

1.  Is there anything wrong with the settings above or is there a setting I have overlooked?
2.  Is there a log file I can check to try and troubleshoot this issue?

Cheers,

Paul
ASKER CERTIFIED SOLUTION
Avatar of domdorn
domdorn
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrgordonz

ASKER

There is a setting in HelpSpot which lets you switch where attachments are saved from the database to file system.  I tried setting it to use the file system, but it made no difference - I can upload a 2 MB file, but not a 4 MB file.  I even updated the PHP settings to make

upload_max_filesize = 32M
post_max_size = 48M  (I made this bigger because I have read elsewhere that the post_max_size needs to be bigger than the actual file being uploaded).

The fact that it behaves the same even when saving attachments on the file system makes me think that it has nothing to do with the database (ie:  max_allowed_packet).

Is there a log file for which would help diagnose the problem.

Cheers,

Paul
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Problem solved.  Turns out that there was a setting hidden deep in HelpSpot that limited the size of attachments.  That alone wasn't the problem though - I also needed to increase the max attachment size setting in Postfix.  Thanks to all who made suggestions.  Given that none of the comments actually solved the problem, but you were all kind enough to try and help, I will split the points evenly.

Cheers,

Paul
Given that none of the comments actually solved the problem, but you were all kind enough to try and help, I will split the points evenly.