0

I'm not able to use 'drush status' when 'localhost' is in my settings. If I switch to '127.0.0.1', Drush status works, but it isn't connected properly; ading a port hangs it. I'm using MAMP Pro 3, and it prefers 'localhost' and port 8889. If I use the IP version, MAMP throws a PDO exception (or times out, depending on whether I add a port).

How do I configure MAMP 3 to work with Drush?

Except for the MAMP version, my problem is similar to Drush enable error and Drush install on local server error (Command pm-enable needs a higher bootstrap level). I have created the symbolic link recommended there, but I'm not sure whether MAMP uses the /var path.

My error is:

    <h1>Additional uncaught exception thrown while handling exception.</h1>
    <h2>Original</h2><p>PDOException: SQLSTATE[HY000] [2002] No such file or directory in drupal_is_denied()
    (line 1921 of /Users/mypath/includes/bootstrap.inc).</p><h2>Additional</h2><p>PDOException: SQLSTATE[HY000] [2002]
    No such file or directory in _registry_check_code() (line 3194 of /Users/mypath/includes/bootstrap.inc).</p>
    <hr />Drush command terminated abnormally due to an unrecoverable error.
    [error]
Community
  • 1
  • 1
senortim
  • 111
  • 1
  • 6

1 Answers1

3

Found my own answer. This error is related to MAMP using a different version of PHP. When I changed my $PATH to point to the correct version, Drush started working correctly.

Steps:

  1. Check MAMP's phpinfo to find the path to the PHP version it is using.
  2. Edit .bash_profile with something like (making sure to use the correct PHP version):

    export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.6.10/bin:$PATH"
    
senortim
  • 111
  • 1
  • 6