对于OS X和Linux:
调出Terminal,Bash或您的普通外壳。
在Terminal / Bash中输入以下内容:
# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
php -r "readfile('http://files.drush.org/drush.phar');" > drush
# Or use our upcoming release: php -r "readfile('http://files.drush.org/drush-unstable.phar');" > drush
# Test your install.
php drush core-status
# Make `drush` executable as a command from anywhere. Destination can be anywhere on $PATH.
chmod +x drush
sudo mv drush /usr/local/bin
# Optional. Enrich the bash startup file with completion and aliases.
drush init
对于Windows:
从GitHub下载Drush。
将压缩文件解压缩到所需的驱动器中,例如。
C:\
安装Drush,在环境路径变量中定义提取的文件夹路径,该变量还应包含Apache, PHP and MySQL。
C:\xampp\apache\bin;C:\xampp\mysql\bin;C:\xampp\php;C:\drush;
验证Drush是否有效:
drush status
全局安装Composer。
通过将Composer的bin目录添加export PATH="$HOME/.composer/vendor/bin:$PATH"到您的〜/ .bash_profile(OS X)或〜/ .bashrc(Linux)中,将其添加到系统路径。
安装Drush:
composer global require drush/drush
验证Drush是否有效:
drush status
Drush Docs的更多详细信息