dockerdrushddev

Why can't I execute vendor/bin/drush (no execute permission on the file)


I have a docker and DDEV setup running on a linux/amd64 machine.

While all commands are working as expected, does ddev drush ... not.

This error is given:

/mnt/ddev_config/.global_commands/web/drush: line 14: /var/www/html/vendor/bin/drush: Permission denied Failed to run drush : exit status 126 I have read about the expirimental features but am not able to disbale them.

Due to this article I created a daemon.json in /etc/docker

{
  "experimental": false
}

but did didn't resolve my problem

info:

// docker version
Client:
 Version:           20.10.14+dfsg1
 API version:       1.41
 Go version:        go1.18
 Git commit:        a224086
 Built:             Wed Mar 30 16:07:00 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true


Solution

  • The reason for your problem is that vendor/bin/drush has somehow gotten its executable bit removed (apparently on the host side), so when ddev drush tries to execute it, it fails... because it's not executable.

    The error message tried to explain this: "/var/www/html/vendor/bin/drush: Permission denied Failed to run drush : exit status 126" and the exit code 126 is about executable status.

    The fix is chmod +x vendor/bin/drush