I am working with drupal 8, MAMP version 3.5, and drush version 8.1.3. I have installed drush globally and when I enter drush st it gives me complete information and shows that drush is installed but when I run drush cc, it gives me only two options

  1. cancel
  2. drush

whereas, it is suppose to give me many options. I am in a root folder of the site I am working on .i.e. /Applications/MAMP/htdocs/mysites/mysite. My OS is OSX on macbook pro, just in case if this is mac specific issue.

Done with this step as well:

sudo ln -s /Applications/MAMP/tmp/mysql /var/mysql

Not sure what else to look into, can you anyone please guide? I am new to drush, terminal and mac

  • 1
    Is the drupal site running? – autopoietic Aug 16 '16 at 7:54
  • Yupx ! drupal site is running fine :) – atif Aug 16 '16 at 8:15
  • does the directory you are in include an index.php file? (ls -l to list files) – autopoietic Aug 16 '16 at 8:51
  • Yupx it does have index.php file in that directory which illustrates that I am in root directory :) – atif Aug 16 '16 at 8:57
  • sorry, just wanted to be sure :) – autopoietic Aug 16 '16 at 8:57

Use drush cr (container rebuild) rather than drush cc (clear cache) for drupal 8.

  • Got this error: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such[error] file or directory' in /Applications/MAMP/htdocs/mysites/mysite/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:142 – atif Aug 16 '16 at 9:11
  • I have resolved the error mentioned in above comment, now drush cr works but drush cc still gives only two options – atif Aug 16 '16 at 9:30

I found a solution which worked for me on this link : https://www.drupal.org/node/1016268#comment-10466949

And the proposed solution on comment # 31 was:

  1. Add this to your .bash_profile export PATH=/Applications/MAMP/Library/bin/:$PATH
  2. run this then in terminal source ~/.bash_profile

It ended my 3 days search to resolve my issue.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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