Answers.Body: <p>This may indicate that either:</p>
  
  <ul>
  <li>The PHP runtime is missing the PDO or MySQL extensions.  This may help: <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP" rel="noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP</a> (At time of writing, I'd avoid PHP 5.6 for CLI dev -- GenCode may have issues with it.)</li>
  <li>The DB settings haven't been configured (e.g. the step for running <code>amp config</code> was skipped).</li>
  <li>An incompatible or incorrect value was used in the DB settings.</li>
  </ul>
  
  <p>For reference, I believe these are the settings for use with a typical MAMP. (Note: The line is long.)</p>
  
  <pre><code>amp config:set --db_type=mysql_dsn --mysql_dsn='mysql://root:root@127.0.0.1:3306' --httpd_type=apache --httpd_restart_command='/Applications/MAMP/Library/bin/apachectl graceful' --hosts_type=file  --perm_type=osxAcl --perm_user=www
  </code></pre>
  
  <p>However, if you didn't run <code>amp config</code> before, it's still good to run it to see more complete instructions (esp. regarding <code>httpd.conf</code>).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-23T12:41:41.683Z
Answers.Text: Thank you! I had skipped over the 'amp config' step somehow. Past this error now and trying to stagger through some other issues. ;)
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-22T21:55:53.290Z
Answers.LastActivityDate: 2016-04-22T21:55:53.290Z
Answers.UserDisplayName: Tim Otten
Body: <p>I am trying to install buildkit on a Mac with MAMP, but am hitting this wall: </p>
  
  <blockquote>
    <p><strong>Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58</strong></p>
  </blockquote>
  
  <p>What am I missing?</p>
  
  <p>I have been following the <a href="https://github.com/civicrm/civicrm-buildkit" rel="nofollow noreferrer">buildkit readme</a> and have gone through <a href="https://civicrm.stackexchange.com/questions/635/how-do-i-set-up-dev-environment-with-buildkit/639#639">this thread about setting up with MAMP</a> but am not sure where I went wrong because I get the error when I actually try to use it.</p>
  
  <pre><code>MacOSX:dmaster.localhost user$ civibuild create dmaster
  [[Download dmaster (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
  Already downloaded dmaster
  [[Install dmaster/default (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
  [[Execute /Users/user/buildkit/app/config/drupal-demo/install.sh]]
  ++ source /Users/user/buildkit/app/config/drupal-demo/install.sh
  +++ amp_install
  +++ _amp_install_cms
  +++ echo '[[Setup MySQL and HTTP for CMS]]'
  [[Setup MySQL and HTTP for CMS]]
  +++ cvutil_assertvars _amp_install_cms CMS_ROOT SITE_NAME SITE_ID TMPDIR
  +++ _cvutil_assertvars_back=ehxB
  +++ set +x
  ++++ mktemp.php ampvar
  +++ local amp_vars_file_path=/Users/user/buildkit/app/tmp/ampvar3Oj48j
  +++ local amp_name=cmsdefault
  +++ '[' default == default ']'
  +++ amp_name=cms
  +++ '[' -n http://dmaster.dev ']'
  +++ amp create -f --root=/Users/user/buildkit/build/dmaster --name=cms --prefix=CMS_ --url=http://dmaster.dev --output-file=/Users/user/buildkit/app/tmp/ampvar3Oj48j --perm=admin
  PHP Fatal error:  Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
  
  Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
  </code></pre>
  
Tags: <civicrm-buildkit><mamp>
Title: Using buildkit on MAMP but hitting "Fatal error: Call to a member function getDriver() on null"
ThreadText: # Using buildkit on MAMP but hitting "Fatal error: Call to a member function getDriver() on null"
  
  (Asked by: username_0 on 2016-04-22)
  
  I am trying to install buildkit on a Mac with MAMP, but am hitting this wall: 
  
  Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
  
  What am I missing?
  I have been following the buildkit readme and have gone through this thread about setting up with MAMP but am not sure where I went wrong because I get the error when I actually try to use it.
  MacOSX:dmaster.localhost user$ civibuild create dmaster
  [[Download dmaster (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
  Already downloaded dmaster
  [[Install dmaster/default (type 'drupal-demo' in '/Users/user/buildkit/build/dmaster')]]
  [[Execute /Users/user/buildkit/app/config/drupal-demo/install.sh]]
  ++ source /Users/user/buildkit/app/config/drupal-demo/install.sh
  +++ amp_install
  +++ _amp_install_cms
  +++ echo '[[Setup MySQL and HTTP for CMS]]'
  [[Setup MySQL and HTTP for CMS]]
  +++ cvutil_assertvars _amp_install_cms CMS_ROOT SITE_NAME SITE_ID TMPDIR
  +++ _cvutil_assertvars_back=ehxB
  +++ set +x
  ++++ mktemp.php ampvar
  +++ local amp_vars_file_path=/Users/user/buildkit/app/tmp/ampvar3Oj48j
  +++ local amp_name=cmsdefault
  +++ '[' default == default ']'
  +++ amp_name=cms
  +++ '[' -n http://dmaster.dev ']'
  +++ amp create -f --root=/Users/user/buildkit/build/dmaster --name=cms --prefix=CMS_ --url=http://dmaster.dev --output-file=/Users/user/buildkit/app/tmp/ampvar3Oj48j --perm=admin
  PHP Fatal error:  Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
  
  Fatal error: Call to a member function getDriver() on null in phar:///Users/user/buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
  
  **Tags:** civicrm-buildkit, mamp
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-22. Score: 5 | Accepted answer
  
  This may indicate that either:
  
  The PHP runtime is missing the PDO or MySQL extensions.  This may help: https://wiki.civicrm.org/confluence/display/CRMDOC/Setup+Command-Line+PHP (At time of writing, I'd avoid PHP 5.6 for CLI dev -- GenCode may have issues with it.)
  The DB settings haven't been configured (e.g. the step for running amp config was skipped).
  An incompatible or incorrect value was used in the DB settings.
  
  For reference, I believe these are the settings for use with a typical MAMP. (Note: The line is long.)
  amp config:set --db_type=mysql_dsn --mysql_dsn='mysql://root:root@127.0.0.1:3306' --httpd_type=apache --httpd_restart_command='/Applications/MAMP/Library/bin/apachectl graceful' --hosts_type=file  --perm_type=osxAcl --perm_user=www
  
  However, if you didn't run amp config before, it's still good to run it to see more complete instructions (esp. regarding httpd.conf).
  
  > **Comments:**
  > **username_0**: Thank you! I had skipped over the 'amp config' step somehow. Past this error now and trying to stagger through some other issues. ;)  
  
  ---
  
  