I’m running Ubuntu 14.04.5 with Drush v 8.1.8 and I can’t seem to execute Drush without using sudo. For example if I try to execute ‘drush cc all’ without sudo, I get:
‘Directory /home/myuser/.drush/cache/default exists, but is not writable. Please check directory permissions. ‘
‘Directory /home/myuser/.drush/cache/complete exists, but is not writable. Please check directory permissions. ’
If I then manually modify the permissions on .drush and everything under it to 777, the next Drush command will work but the one after that will fail with the same error. I also tried ‘chown -R myuser:myuser ~/.drush’. Same result.
I thought perhaps I installed Drush incorrectly, so I tried removing and then re-installing it three different ways:
- Using this approach: https://www.drupal.org/node/1248790 (sudu apt-get install drush).
- This way: http://docs.drush.org/en/master/install/ (executing php to load Drush from a remote file)
- Finally by installing Drush using method (2) and then moving Drush into my home/bin folder and chown -R to me.
All of them have the same result — drush doesn’t work without sudo. There’s no reason I can think of why this should be. What’s even weirder is if I chown of .drush (and everything under it) to me, then execute drush without sudo, it will change ownership of directories under .drush/cache to root. I don’t even know how that’s possible since I’m not root!
Please let me know how I can get Drush to work without root privileges. Thanks.