I use Mantis at work (and at play) to manage bug and issue tracking. If you’re not familiar with it, I highly recommend checking it out.

So recently, I wanted to attach a large file (10MB wowzers!) to one of my bugs. When I attempted the upload, however, Mantis decided to throw an error at me suggesting that the max upload file size in PHP was preventing it from uploading the file. So, I loaded up php.ini and updated the two applicable lines:


Woohoo! Ok, let’s upload the file now…

Database query failed. Error received from database was #2006: MySQL server has gone away for the query

What the heck!? Where did it go? MySQL, why have you forsaken me!?

So, after a bit of searching it turns out it’s related to the packet size setting in my.ini.

To fix it, load up your my.ini and find “max_allowed_packet”. Set it to whatever you set in your php.ini.

For example:

Hopefully that’ll fix your issue!