4

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
4

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).

  • Thank you! I had skipped over the 'amp config' step somehow. Past this error now and trying to stagger through some other issues. ;) – Laryn - CEDC.org Apr 23 '16 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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