D7 in sub directory - Not able to log in I have a Drupal site I need to show for portfolio reasons so I have installed it in a sub directory. 


I have changed the rewritebase to /subdir


Initially without that change I was served the homepage just fine but no interior pages. With that change I was able to get deeper into this site but when I went to login the backend it loaded forever and spit out this error:


  Additional uncaught exception thrown while handling exception.
  
  Original
  
  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC; Array ( [:alias] =&gt; user [:language] =&gt; en [:language_none] =&gt; und ) in drupal_lookup_path() (line 176 of /home/content/k/c/l/name/html/fsubdir/includes/path.inc).
  
  Additional
  
  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] =&gt; 0 [:db_insert_placeholder_1] =&gt; php [:db_insert_placeholder_2] =&gt; %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] =&gt; a:6:{s:5:&quot;%type&quot;;s:12:&quot;PDOException&quot;;s:8:&quot;!message&quot;;s:284:&quot;SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC; Array ( [:alias] =&amp;gt; user [:language] =&amp;gt; en [:language_none] =&amp;gt; und ) &quot;;s:9:&quot;%function&quot;;s:20:&quot;drupal_lookup_path()&quot;;s:5:&quot;%file&quot;;s:61:&quot;/home/content/k/c/l/name/html/subdir/includes/path.inc&quot;;s:5:&quot;%line&quot;;i:176;s:14:&quot;severity_level&quot;;i:3;} [:db_insert_placeholder_4] =&gt; 3 [:db_insert_placeholder_5] =&gt; [:db_insert_placeholder_6] =&gt; http://mydomain.com/subdir/?q=user [:db_insert_placeholder_7] =&gt; [:db_insert_placeholder_8] =&gt; 173.10.171.18 [:db_insert_placeholder_9] =&gt; 1354293470 ) in dblog_watchdog() (line 157 of /home/content/k/c/l/name/html/subdir/modules/dblog/dblog.module).


Can anyone point me in the right direction to get this resolved?
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.