View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006318 | mantisbt | sql | public | 2005-10-05 16:32 | 2012-08-17 14:11 |
Reporter | pchaintreuil | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
OS | Gentoo Linux | ||||
Product Version | 1.0.0rc1 | ||||
Summary | 0006318: APPLICATION ERROR 0000401 when uploading a file. | ||||
Description | I get the following: Database query failed. Error received from database was 0001153: Got a packet bigger than 'max_allowed_packet' for the query:
(where the '*snip' "binary" data.) when trying to upload a certain file. | ||||
Steps To Reproduce | 1.) Navigate to any bug. | ||||
Tags | No tags attached. | ||||
duplicate of | 0008867 | closed | ryandesign | APPLICATION ERROR 0000401 while uploading files into MySQL |
The file is about 1 Meg (less than the 50meg limit set in PHP & Mantis). You can get a gzip'ed version of it from http://tinyurl.com/7r93x (You'll probably have to right-click and "save-as" on that link). Remember to unzip it before trying to replicate the bug as the zipped version does not cause the problem. My back-end DB is a MySQL one. |
|
Raising the my /etc/mysql/my.cnf's pair of max_allowed_packet variable to 20M (from their default of 1M) allows me to upload the file. (I also changed my php.ini's upload_max_filesize to 20M and Mantis's config_inc.php's g_max_file_size to 20000000.) This should probably be handled more correctly, at least like when you blatently try to upload a file that's too large. Additionally, I don't know how much bloat occurs when "escaping" the binary file into something that can be sent to the database happens. Does it expand by a factor of two? More? This should probably be better documented too.... |
|
You need to adjust the "max_packet_size" setting in the mySQL configuration file (usually /etc/my.cnf) to match the maxinim uploaded file size. See http://www.futureware.biz/blog/index.php?p=112&more=1&c=1&tb=1&pb=1 for details. |
|
Do you think it's logical for the admin check installation page to verify that all these variables sync? Are they all determinable from within PHP? |
|
The SQL parameters are not readily available to PHP in a way that is database neutral. We might add database specific code to address this. |
|
This looks to be a duplicate of 0008867 which has been resolved. It may be worth adding some logic or documentation for this issue as it appears to be common. |
|
I just found this in the notes section of the page http://it.php.net/manual/en/mysqli.options.php honestly, I'm not sure if it will work at all but it's worth noting Example on using mysqli_options to increase size of max_allowed_packet for working with big blobs. function dbConnect() $mysqli = mysqli_init(); Unable to connect ');return $mysqli; |
|