在Godaddy Webhosting安裝drush筆記

找到這篇文章,確定可以在Godaddy Web Hosting上執行drush
HOW-TO Set up Drush on a GoDaddy shared hosting plan | Roberto Montero

不過之後的新版本,要用composer 才能安裝
底下是安裝的指令,ssh登入後即可執行

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar composer
$ alias composer='/usr/bin/php5 ~/composer'
$ composer global require drush/drush:dev-master
$ alias drush='/usr/bin/php5 ~/.composer/vendor/drush/drush/drush.php'
$ drush help

參考資料 Installing Drush 7 using Composer

PS. "/usr/bin/php5" 每一台的主機狀況都不太一樣,需自尋路徑唷!

裝好後要更新模組
drush pm-update --no-core

更新主程式
drush pm-update project drupal

我在 Godaddy的Webhosting有兩個版本,較舊的主機PHP版本為5.3,所以改用其他的方式
參考:Installing Drush On Any Linux Based Server Out There

$ wget http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
$ tar zxvf drush-7.x-5.9.tar.gz
$ alias drush='/usr/local/php5_3/bin/php ~/drush/drush.php'

程式執行時會有錯誤訊息,但忽視似乎也不影響

The following restricted PHP modes have non-empty values:            [error]
magic_quotes_gpc. This configuration is incompatible with drush.
Please check your configuration settings in /web/conf/php5.ini or in
your drush.ini file; see examples/example.drush.ini for details.

2018.06.12筆記
今天在使用drush的時候,突然無法用了,路徑改成下面就能解決 :)
alias drush='/usr/local/bin/ea-php56 ~/.composer/vendor/drush/drush/drush.php'

留言

熱門文章