This has nothing to do with Magento or PHP. It’s a MySql error generated because of the poor configuration of the MySql server. I run in a similar problem with a client when executing bulk inserts MySql was generating “General error: 2006 MySQL server has gone away” because of the "packet too large" exception. In my case the solution was to ask the hosting provider to change in the MySql configuration files on the server /etc/my.cnf max_allowed_packet = 1M to 16M or more. So I recommend you to optimize MySql configuration for Magento. Another suggestion is try to upgrade MySql to the latest version because some things its handled differently in latest versions.