I can't install D7 HEAD on MAMP, PHP 5.2.5

When I submit the database connection settings page, PHP dies with the following trace:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_7.variable' doesn't exist' in /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/database/database.inc:1734
Stack trace:
#0 /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/database/database.inc(1734): PDOStatement->execute(Array)
#1 /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/database/database.inc(567): DatabaseStatementBase->execute(Array, Array)
#2 /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/database/database.inc(1822): DatabaseConnection->query('SELECT value FR...', Array, Array)
#3 /Users/sime/Repos/drupal-cvs/core/drupal-7/install.php(759): db_query('SELECT value FR...', 'install_task')
#4 /Users/sime/Repos/drupal-cvs/core/drupal-7/install.php(993): install_verify_completed_task()
#5 /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/form.inc(878): install_settings_form_submit(Array, Array)
#6 /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/form.inc(536): form_execut in /Users/sime/Repos/drupal-cvs/core/drupal-7/includes/database/database.inc on line 1734

This is occuring when install_verify_completed_task() tries to query the variable table before the table exists. Clearly, according to the comments in the code, this is supposed to be a caught exception, but is uncaught - I have failed to work out what the cause is, I haven't worked with the try/catch construct before maybe this is something simple.

The code for convenience...

function install_verify_completed_task() {
  try {
    if ($result = db_query("SELECT value FROM {variable} WHERE name = '%s'", 'install_task')) {
      $task = unserialize(db_result($result));
    }
  }
  // Do not trigger an error if the database query fails, since the database
  // might not be set up yet.
  catch (Exception $e) {
  }
  ...

Comments

sime’s picture

Oh, I verified that tables can be created ok in the database. It's creating and deleting the table "drupal_install_test" fine.

sime’s picture

With fresh checkout:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_7.variable' doesn't exist' in /Users/sime/Sites/d7/includes/database/database.inc:1786
Stack trace:
#0 /Users/sime/Sites/d7/includes/database/database.inc(1786): PDOStatement->execute(Array)
#1 /Users/sime/Sites/d7/includes/database/database.inc(568): DatabaseStatementBase->execute(Array, Array)
#2 /Users/sime/Sites/d7/includes/database/database.inc(1872): DatabaseConnection->query('SELECT value FR...', Array, Array)
#3 /Users/sime/Sites/d7/install.php(774): db_query('SELECT value FR...', Array)
#4 /Users/sime/Sites/d7/install.php(1011): install_verify_completed_task()
#5 /Users/sime/Sites/d7/includes/form.inc(915): install_settings_form_submit(Array, Array)
#6 /Users/sime/Sites/d7/includes/form.inc(560): form_execute_handlers('submit', Array, Array)
#7 /Users/sime/Sites/d7/includes/form.inc(198): drupal_process_form('install_setting...', Array, Array)
#8 /Users/sime/Sites/d7/install.php(400): dru in /Users/sime/Sites/d7/includes/database/database.inc on line 1786

This is the line that throws the exception, if I read my code right.

// $Id: database.inc,v 1.81 2009/10/18 06:56:24 webchick Exp $
...
// Line 1786
$return = parent::execute($args);
sime’s picture

Category: bug » support
Status: Active » Fixed

This is a bug with eaccellerator in MAMP. I successfully switched to APC.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

restyler’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Oh, I coudln't install Drupal 7 , with same error. Thank you! I've disabled eAccelerator0951_5.2.4.dll and managed to install D7 after that (winXP).
Was this problem fixed in new eAcc? Is it possible to rewrite piece of D7 code causing this problem?

marcvangend’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

If this a problem with MAMP/eaccellerator, then that is where it should be fixed. Closing again.

David_Rothstein’s picture

Note: Continuing discussion of eAccellerator issues at #914742: Add hook_requirements() for buggy versions of eAccelerator.

It is likely this is not something Drupal can work around, but we should take the time to determine that definitively as it seems to be a popular configuration, and a nasty bug.