Today one of my websites started showing
Error Number: 2006 MySQL server has gone away
It\'s a low-traffic client site running under Apache 2.2.9 (Debian
As I said in my update, I concluded that the problem with MySQL arises when the link to Facebook takes longer than the maximum connection time with the DB. None of the suggestions could beat this limitation, so I decided to work around it and reconnect every time I presumed the link maybe gone.
So after each call to Facebook, I used to following code:
$this->load->database(); $this->db->reconnect();
This is the particular solution when using CodeIgniter, and AFAIK the db->reconnect() function is only available since version 1.7.2 so I updated it in order to work.
Thanks everyone for your answers!