D7 in sub directory - Not able to log in
The server gone away error is an error that happens when the client cannot connect to the  database server, and it can happen because:


The client doesn't have the necessary privileges to access the database 
There has been a timeout on the TCP/IP connection
The client is running on Windows, and the server dropped the connection, probably because a timeout


When I got that error on my sites was always because the credentials I used in the settings.php file were wrong.
The other reason to get that error is that the value of max_allowed_packet is too small.