Local drush stops working after changing files and folder permissions So I changed the files and folder permissions with the following commands on Drupal 8 and after that, I can't run drush commands unless I change file permissions to 777

find . -type f -print0 | xargs -0 chmod 0644
find . -type d -print0 | xargs -0 chmod 0755


Here's the error I get after I run drush cr for example:

PHP Warning:  pcntl_exec(): Error has occurred: (errno 13) Permission denied in /usr/local/bin/drush-8/vendor/drush/drush/includes/startup.inc on line 415
Error has occurred executing the Drush script found at /data/websites/virtualmax.ca/public_html/vendor/drush/drush/drush
(errno 13) Permission denied


I wonder if there's a certain permission required to be able to run local drush installed with composer
Apparently, you have two Drush instances installed, as you can see in your error log, it tries to run the global Drush which is located at /usr/local/bin/drush-8/vendor/drush/drush first

the reason that you cannot run Drush commands locally after file permission changes is that it's not executable, try this in your installation root:

sudo chmod +x vendor/drush/drush/drush