Lorna Jane Mitchell – whom I won’t even pretend to introduce to you because everybody knows Lorna – recently wrote a blog post for her blog titled “Dealing With MySQL Gone Away in Zend Framework”. In it she discusses a solution she came up with to a nagging problem she has been having with PHP, Zend Framework and Gearman.
I wrote recently about having gearman in my application, however I have been seeing problems with the long-running PHP worker scripts. My logs had entries like this:
1 SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The post is short and to the point with exactly 3 lines of code. However, if you are working with MySQL and Zend Framework, it’s an important lesson. Learn from her so you don’t have to lear it yourself. :)
p.s. This post was also covered by our good friends over at phpdeveloper.org.