使用composer來更新Drupal最為方便,故先安裝composer
1. 創建composer.sh
touch composer.sh
2. 使用任一文字編輯軟件打開composer.sh,在內加入以下內容,存檔及登出。
EXPECTED_SIGNATURE=$(wget -q -O – https://composer.github.io/installer.sig)
php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);”
ACTUAL_SIGNATURE=$(php -r “echo hash_file(‘SHA384’, ‘composer-setup.php’);”)
if [ “$EXPECTED_SIGNATURE” != “$ACTUAL_SIGNATURE” ]
then
>&2 echo ‘ERROR: Invalid installer signature’
rm composer-setup.php
exit 1
fi
php composer-setup.php –quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
3. 設定composer.sh可以執行
sudo chmod +x composer.sh
4. 執行composer.sh
./composer.sh
5. 搬移composer.phar使composer能在系統任何地方都可使用
sudo mv composer.phar /usr/local/bin/composer
6. 執行composer,確認已成功安裝
composer
+++ 大功告 +++