Drush dl ไม่ทำงานกับ PHP 7 และ Ubuntu 16.04


11

เมื่อฉันพยายามทำ:

drush dl drupal-8

ฉันได้รับข้อผิดพลาดต่อไปนี้:

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.

คำสั่งอื่น ๆ ใช้งานได้: drush cc, สถานะ drush

นี่คือสถานะเอาต์พุตของ 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      :

คำตอบ:


17

ดูเหมือนว่าคุณจะสามารถติดตั้ง / กำหนดค่า PHP ได้โดยไม่ต้องใช้นามสกุล Simplexml

ติดตั้งแพ็คเกจ php7.0-xml ด้วย apt-get ดังนี้

sudo apt-get install php-xml

ตรวจสอบตัวติดตั้ง UI หากคุณพลาดสิ่งนี้ไปคุณอาจพลาดลิงก์ mbstring, gd และอื่น ๆ อีกมากมายที่จะติดตั้ง / ใช้ Drupal


ยืนยันแล้วสิ่งนี้ใช้ได้ผลและจำเป็นต้องทำสิ่งนี้สำหรับการติดตั้ง Ubuntu แบบมาตรฐาน 16.04
Darrell Ulm
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.