Drush dl não funciona com PHP 7 e ubuntu 16.04

11

Quando tento fazer:

drush dl drupal-8

Eu obtenho o seguinte erro:

PHP Fatal error:  Uncaught Error: Call to undefined function Drush\UpdateService\simplexml_load_file() in /home/alexander/.config/composer/vendor/drush/drush/lib/Drush/UpdateService/Project.php:74
Stack trace:
#0 /home/alexander/.config/composer/vendor/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php(64): Drush\UpdateService\Project::getInstance(Array, 86400)
#1 /home/alexander/.config/composer/vendor/drush/drush/lib/Drush/UpdateService/ReleaseInfo.php(122): Drush\UpdateService\ReleaseInfo->get(Array)
#2 /home/alexander/.config/composer/vendor/drush/drush/commands/pm/download.pm.inc(111): Drush\UpdateService\ReleaseInfo->selectReleaseBasedOnStrategy(Array, '', 'auto', false, NULL)
#3 /home/alexander/.config/composer/vendor/drush/drush/includes/command.inc(366): drush_pm_download()
#4 /home/alexander/.config/composer/vendor/drush/drush/includes/command.inc(217): _drush_invoke_hooks(Array, Array)
#5 /home/alexander/.config/composer/vendor/drush/drush/includes/command.inc(185): drush_command()
#6 /home/alexander/.config/compos in /home/alexander/.config/composer/vendor/drush/drush/lib/Drush/UpdateService/Project.php on line 74
Drush command terminated abnormally due to an unrecoverable error.

Outros comandos funcionam: drush cc, status de drush.

Aqui está a saída do status de drush:

 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php/7.0/cli/php.ini
 PHP OS                 :  Linux
 Drush script           :  /home/alexander/.config/composer/vendor/drush/drush/drush.php
 Drush version          :  8.1.2
 Drush temp directory   :  /tmp
 Drush configuration    :
 Drush alias files      :
Alexander Kim
fonte

Respostas:

17

Parece que você conseguiu instalar / configurar o PHP sem a extensão simplexml.

Instale o pacote php7.0-xml com o apt-get da seguinte maneira.

sudo apt-get install php-xml

Verifique também o instalador da interface do usuário, se você estiver com falta disso, provavelmente também está faltando um monte de outras extensões, link mbstring, gd e assim por diante para instalar / usar o Drupal.

Berdir
fonte
Verificado, isso funcionou e precisava ser feito para a instalação padrão do Ubuntu 16.04.
Darrell Ulm