Skip to main content
Replace the word "initialize" to avoid confusion.
Source Link
greg_1_anderson
  • 21.4k
  • 2
  • 38
  • 47

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Update:

To make things work correctly, you need to understand how bash initializes itself. For example, did you know that .bash_profile is sourced if you run ssh user@host, but it is not sourced if you run ssh user@host pwd? Drush uses the later form to re-launch Drush subprocesses, so if you initialize your PATH in .bash_profile, then it will be fine when you test it in the shell, but it will be broken for Drush subprocesses.

To get around this problem, you should also initializeexport your PATH in your .bashrc file, as bash will source this file for non-login shells. Be sure to initializeset up your PATH at the TOP of the file, as there is a line near the top that reads: [ -z "$PS1" ] && return. This causes the script to exit if ssh did not create a tty (run ssh -t to create a tty; Drush adds this flag for interactive commands only.)

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Update:

To make things work correctly, you need to understand how bash initializes itself. For example, did you know that .bash_profile is sourced if you run ssh user@host, but it is not sourced if you run ssh user@host pwd? Drush uses the later form to re-launch Drush subprocesses, so if you initialize your PATH in .bash_profile, then it will be fine when you test it in the shell, but it will be broken for Drush subprocesses.

To get around this problem, you should also initialize your PATH in your .bashrc file, as bash will source this file for non-login shells. Be sure to initialize your PATH at the TOP of the file, as there is a line near the top that reads: [ -z "$PS1" ] && return. This causes the script to exit if ssh did not create a tty (run ssh -t to create a tty; Drush adds this flag for interactive commands only.)

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Update:

To make things work correctly, you need to understand how bash initializes itself. For example, did you know that .bash_profile is sourced if you run ssh user@host, but it is not sourced if you run ssh user@host pwd? Drush uses the later form to re-launch Drush subprocesses, so if you initialize your PATH in .bash_profile, then it will be fine when you test it in the shell, but it will be broken for Drush subprocesses.

To get around this problem, you should also export your PATH in your .bashrc file, as bash will source this file for non-login shells. Be sure to set up your PATH at the TOP of the file, as there is a line near the top that reads: [ -z "$PS1" ] && return. This causes the script to exit if ssh did not create a tty (run ssh -t to create a tty; Drush adds this flag for interactive commands only.)

added 863 characters in body
Source Link
greg_1_anderson
  • 21.4k
  • 2
  • 38
  • 47

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Update:

To make things work correctly, you need to understand how bash initializes itself. For example, did you know that .bash_profile is sourced if you run ssh user@host, but it is not sourced if you run ssh user@host pwd? Drush uses the later form to re-launch Drush subprocesses, so if you initialize your PATH in .bash_profile, then it will be fine when you test it in the shell, but it will be broken for Drush subprocesses.

To get around this problem, you should also initialize your PATH in your .bashrc file, as bash will source this file for non-login shells. Be sure to initialize your PATH at the TOP of the file, as there is a line near the top that reads: [ -z "$PS1" ] && return. This causes the script to exit if ssh did not create a tty (run ssh -t to create a tty; Drush adds this flag for interactive commands only.)

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.

Update:

To make things work correctly, you need to understand how bash initializes itself. For example, did you know that .bash_profile is sourced if you run ssh user@host, but it is not sourced if you run ssh user@host pwd? Drush uses the later form to re-launch Drush subprocesses, so if you initialize your PATH in .bash_profile, then it will be fine when you test it in the shell, but it will be broken for Drush subprocesses.

To get around this problem, you should also initialize your PATH in your .bashrc file, as bash will source this file for non-login shells. Be sure to initialize your PATH at the TOP of the file, as there is a line near the top that reads: [ -z "$PS1" ] && return. This causes the script to exit if ssh did not create a tty (run ssh -t to create a tty; Drush adds this flag for interactive commands only.)

Source Link
greg_1_anderson
  • 21.4k
  • 2
  • 38
  • 47

Exit code 127 means "command not found", just as the error message says. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If php is in your PATH, then this should not happen. If you want to explicitly tell Drush which php to run, then set the DRUSH_PHP environment variable as explained in the Drush README. This should help out in the case of Drush commands such as the ones you mention before, that run a Drush subcommand in a new process.