It could be many things. I've had the sql server gone away message a few times myself. I can't remember what caused it but I know I had to tinker with a few settings and the code too.
Watch out for date and mktime functions too. I can't remember what but I ran into trouble with both of those when tranferring my code from my 5.3.0 wamp to a linux 5.2.7 setup which gave me a lot of head scratching moments to deal with.
My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!