1

My website works right on server, I took a backup from database and public_html in order to have a copy of my webstie in localhost.

I imported the database but it reported an error, some thing was wrong with content of cache_views table, so I emptied this table and database successfully imported. I replaced public_html with the old one and configured settings.php. but it doesn't work, it reports this error :

Additional uncaught exception thrown while handling exception.

Original

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => fa [:source] => Makes the view results available as a context for use in Panels and other applications. [:context] => ) in locale() (line 684 of C:\xampp\htdocs\test\modules\locale\locale.module).

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] => 0 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:455:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => fa [:source] => Makes the view results available as a context for use in Panels and other applications. [:context] => ) ";s:9:"%function";s:8:"locale()";s:5:"%file";s:52:"C:\xampp\htdocs\test\modules\locale\locale.module";s:5:"%line";i:684;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => h t t p://localhost:81/test/ [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1389935326 ) in dblog_watchdog() (line 154 of C:\xampp\htdocs\test\modules\dblog\dblog.module).
  • Try restarting mysql on your local machine and double check if you have the right connection details in settings.php – Sumeet Pareek Jan 17 '14 at 5:19
  • @SumeetPareek I do have right connection details in settings.php, this is the same settings that was working on older version of website. I also restarted mysql and it didn't work – M a m a D Jan 17 '14 at 5:23
5

I solved the problem this way: set max_allowed_packet = 4M to the file php.ini

  • 2
    Thanks sooooooo much it worked :) . in fact it is in my.ini not php.ini . thanks again – M a m a D Jan 17 '14 at 5:45
  • my.cnf for me :) – Janaka R Rajapaksha Dec 22 '14 at 8:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.