I'm having a terrible time with a local Drupal distribution of COD (Conference Organizing Distribution). It works fine and zippy, but I'll add modules to the sites/all/modules directory or enable them in the admin and it will go blank.

Yes, I've read the help docs and have increased my memory_limit to 128M and even 256M.
I'm running PHP 5.4.10 and xCache. I switched to eAccelerator and APC...and nothing.

The error is:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Users/path/to/mysite/includes/database/database.inc:2139 Stack trace: #0 /Users/path/to/mysite/includes/database/database.inc(2139): PDOStatement->execute(Array) #1 /Users/path/to/mysite/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array) #2 /Users/path/to/mysite/includes/database/database.inc(2318): DatabaseConnection->query('SELECT expire, ...', Array, Array) #3 /Users/path/to/mysite/includes/lock.inc(167): db_query('SELECT expire, ...', Array) #4 /Users/path/to/mysite/includes/lock.inc(146): lock_may_be_available('theme_registry:...') #5 /Users/path/to/mysite/includes/theme.inc(447): lock_acquire('theme_registry:...') #6 /Users/path/to/mysite/includes/bootstrap.inc(442): ThemeRegistry->set(Array) #7 [internal function]: DrupalCacheArray->__destruct() #8 {main} thrown in /Users/path/to/mysite/includes/database/database.inc on line 2139

Comments

VM’s picture

what is max_packet set to in my.cnf? see: https://drupal.org/node/984112

finedesign’s picture

Thank you for the feedback. I added my.cnf to the /php5.4.10 directory in mamp with the contents:

[mysqld]
max_allowed_packet = 32M

and after restarting Apache, mamp would not restart. I tried several things, even restarting the computer. Then I switched the default port settings by clicking "Reset MAMP ports" and it permitted me to view the site but as soon as I logged in...the same error. I have placed a info.php file but there is no max_allowed_packet parameter to ensure. However, post_max_size is set to 32M.

VM’s picture

you shouldn't have created a my.cnf file. it's also not a php file it's a mysql file. the setting isn't a php setting. it's a mysql setting. I suggest utilizing mysql.net or reaching out to the MAMP support community.

finedesign’s picture

You may not realize this, but I think you helped solve my problem! I tried following the instructions from the link given above:
https://drupal.org/node/984112#comment-4694182
Because MAMP now has separate folders designated for each version of PHP in the conf folder, I placed my.cnf in the subfolder, when it should have been placed directly in the conf folder.