Ubuntu16.04 安裝Drush 相關套件

以drush下載drupal主程式出現
 Directory /home/user/.drush/cache/default exists, but is not writable. Please check directory           [error]
permissions.
PHP Fatal error:  Uncaught Error: Call to undefined function simplexml_load_file() in /usr/share/php/drush/commands/pm/release_info/updatexml.inc:402
Stack trace:
#0 /usr/share/php/drush/commands/pm/release_info/updatexml.inc(45): updatexml_get_release_history_xml(Array)
#1 /usr/share/php/drush/commands/pm/download.pm.inc(92): release_info_fetch(Array, '', 'auto', false)
#2 /usr/share/php/drush/includes/command.inc(334): drush_pm_download('drupal')
#3 /usr/share/php/drush/includes/command.inc(208): _drush_invoke_hooks('pm-download', Array, 'pm')
#4 /usr/share/php/drush/includes/command.inc(175): drush_command('drupal')
#5 /usr/share/php/drush/drush.php(92): drush_dispatch(Array)
#6 /usr/share/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
#7 /usr/share/php/drush/drush.php(16): drush_main()
#8 {main}
  thrown in /usr/share/php/drush/commands/pm/release_info/updatexml.inc on line 402
Drush command terminated abnormally due to an unrecoverable error.                                      [error]
Error: Uncaught Error: Call to undefined function simplexml_load_file() in
/usr/share/php/drush/commands/pm/release_info/updatexml.inc:402
Stack trace:
#0 /usr/share/php/drush/commands/pm/release_info/updatexml.inc(45):
updatexml_get_release_history_xml(Array)
#1 /usr/share/php/drush/commands/pm/download.pm.inc(92): release_info_fetch(Array, '', 'auto', false)
#2 /usr/share/php/drush/includes/command.inc(334): drush_pm_download('drupal')
#3 /usr/share/php/drush/includes/command.inc(208): _drush_invoke_hooks('pm-download', Array, 'pm')
#4 /usr/share/php/drush/includes/command.inc(175): drush_command('drupal')
#5 /usr/share/php/drush/drush.php(92): drush_dispatch(Array)
#6 /usr/share/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
#7 /usr/share/php/drush/drush.php(16): drush_main()
#8 {main}
  thrown in /usr/share/php/drush/commands/pm/release_info/updatexml.inc, line 402
Sounds like you managed to install/configure PHP without the simplexml extension.
Install the php7.0-xml package with apt-get as follows.
sudo apt-get install php-xml
Also check the UI installer, if you're missing this, then you're likely also missing a bunch of other extensions link mbstring, gd and so on to install/use Drupal.

安裝主程式時也會要求安裝一些擴展套件,記住安裝好後要重啟apache2才會生效。

留言

這個網誌中的熱門文章

LDAP與AD之對應欄位

用openLDAP來做Moodle帳號管理