drush fails to clear cache: Fatal error: Call to undefined function lock_acquire()

2.8k views Asked by At

I have installed Drush 5.6 on my ubuntu machine, and I am now working on a Drupal theme, so I need to clear the cache frequently, but I cannot seem to do it with drush...

When I run the drush cc all inside my drupal site folder, I get the message that it successfully cleared the drush cache.

When I instead run drush cc inside my drupal site folder I get only 3 options (even though I have seen other people get more options here...): to cancel, to clear drush cache, or to clear registry cache. Here I tried to clear the registry cache and got the following error:

Fatal error: Call to undefined function lock_acquire()

pointing me to some bootstrap.inc file

I will be very happy if someone could help me

1

There are 1 answers

0
Sunny On

I just had the same problem. The reason is drush was not able to use the php with MAMP. So you need to add path to your MAMP's php location to ~/.bash_profile.

For me its something like:

export PATH=/Applications/MAMP/bin/php/php5.3.14/bin:$PATH

I am using PHP 5.3 in MAMP, check what version you are using and write the absolute path then do source ~/.bash_profile.

Restart MAMP and re-check.