MySQL server has gone away (avoid php flush)

I recently experienced a problem with a complex MySQL query which reported “MySQL server has gone away” and then just stopped.

There are plenty of posts with suggestions to help you fix this rare but annoying message and it’s likely they will help you more than this post. However I found a solution, and one that I could replicate so that for my particular issue have conclusive evidence of the cause. An unusual luxury.

Remove flush()

It is as simple as that. If you find flush() is called at any time while processing a page that suffers this error, rem it out and try again. More information on flush() can be found here: http://uk3.php.net/flush

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">