Im trying to set up Drush 8 with MAMP Pro.

Short version:

Ive got Drush working so that when I cd to my project root and enter a command like vendor/bin/drush en ban it works fine.

Ive followed these instructions to have a site local Drush. Im trying to make it so that I can just run drush en ban not the full path. http://docs.drush.org/en/master/install/

Ive copied examples/drush.wrapper to my root and renamed the file to just drush. However when I run drush in the terminal it just returns -bash: drush: command not found. If I run vendor/bin/drush en ban again then now I get -bash: vendor/bin/drush: No such file or directory

More detail:

My .bash_profile has the following:

export PATH=/Applications/MAMP/bin/php/php7.0.15/bin:$PATH export PATH=/Applications/MAMP/Library/bin/:$PATH

When I type in which php I get the following, which is the same as I can see in MAMP's UI, so I think its correct. /Applications/MAMP/bin/php/php7.1.1/bin/php

If I run vendor/bin/drush status I get:

vendor/bin/drush status
 Drupal version                  :  8.2.7
 Site URI                        :  http://default
 Database driver                 :  mysql
 Database hostname               :  localhost
 Database port                   :  3306
 Database username               :  root
 Database name                   :  db_1
 Database                        :  Connected
 Drupal bootstrap                :  Successful
 Drupal user                     :
 Default theme                   :  bartik
 Administration theme            :  seven
 PHP executable                  :  /Applications/MAMP/bin/php/php7.0.15/bin/php
 PHP configuration               :  /Applications/MAMP/bin/php/php7.0.15/conf/php.ini
 PHP OS                          :  Darwin
 Drush script                    :  /Users/MYUSERNAME/Sites/PROJECTNAME/1/vendor/drush/drush/drush.php
 Drush version                   :  8.1.10
 Drush temp directory            :  /tmp
 Drush configuration             :
 Drush alias files               :
 Install profile                 :  standard
 Drupal root                     :  /Users/MYUSERNAME/Sites/PROJECTNAME/1
 Drupal Settings File            :  sites/default/settings.php
 Site path                       :  sites/default
 File directory path             :  sites/default/files
 Temporary file directory path   :  /Applications/MAMP/tmp/php
 Sync config path                :  sites/default/files/config_1j990namX0DnLC48TQyG6OJgFYvwOVORkxIedsS
  • 1
    As a start the Drush wrapper must be executable - chmod +x drush. Maybe that is enough. Let us know. PS! Installation guide for Drush 8 is located at docs.drush.org/en/8.x/install Doesn't really matter as the wrapper solution should work.
    – hansfn
    Apr 3 '17 at 10:20
  • Im not entirely sure why but installing drush globally (again) as per the link has made it work. Thanks a lot!
    – Evanss
    Apr 3 '17 at 23:38

Browse other questions tagged or ask your own question.