it-swarm.dev

Kesalahan pemasangan dengan Composer

Saya mencoba menginstal Drupal 8 dengan Komposer. Drupal Konsol sudah diinstal (kalau-kalau itu relevan), jadi saya pergi ke folder localhost saya (berfungsi lokal) dan ketik:

composer create-project drupal-composer/drupal-project:8.x-dev cmpsprjct --stability dev --no-interaction

Semuanya berjalan dengan baik dengan instalasi composer di terminal. Ketika saya mencoba melanjutkan instalasi di browser saya mendapatkan kesalahan sebagai berikut:

Additional uncaught exception thrown while handling exception.
Original

TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::reset() must be an instance of Doctrine\Common\Annotations\void, none returned in Doctrine\Common\Annotations\AnnotationRegistry::reset() (line 55 of /var/www/html/cmpsprjct/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php).

Doctrine\Common\Annotations\AnnotationRegistry::reset() (Line: 113)
Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() (Line: 86)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 283)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 174)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 109)
Drupal\Core\Render\ElementInfoManager->buildInfo('seven') (Line: 76)
Drupal\Core\Render\ElementInfoManager->getInfo('form') (Line: 806)
Drupal\Core\Form\FormBuilder->prepareForm('install_select_language_form', Array, Object) (Line: 272)
Drupal\Core\Form\FormBuilder->buildForm('install_select_language_form', Object) (Line: 898)
install_get_form('Drupal\Core\Installer\Form\SelectLanguageForm', Array) (Line: 1324)
install_select_language(Array) (Line: 670)
install_run_task(Array, Array) (Line: 548)
install_run_tasks(Array) (Line: 117)
install_drupal(Object) (Line: 44)

Additional

TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::reset() must be an instance of Doctrine\Common\Annotations\void, none returned in Doctrine\Common\Annotations\AnnotationRegistry::reset() (line 55 of /var/www/html/cmpsprjct/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php).

Doctrine\Common\Annotations\AnnotationRegistry::reset() (Line: 113)
Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() (Line: 86)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 283)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 174)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 109)
Drupal\Core\Render\ElementInfoManager->buildInfo('seven') (Line: 76)
Drupal\Core\Render\ElementInfoManager->getInfo('html') (Line: 298)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 139)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 140)
Drupal\Core\Render\Renderer->renderRoot(Array) (Line: 66)
Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, 'Error', 'install_page', Array) (Line: 76)
Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, 'Error', 'install_page', Array) (Line: 1004)
install_display_output(Array, Array, Array) (Line: 264)
_drupal_log_error(Array, 1) (Line: 584)
_drupal_exception_handler(Object)

Saya telah mencari di Google dan menemukan bahwa pembaruan composer dapat menyelesaikan masalah, tetapi ternyata tidak. Ada petunjuk tentang cara melanjutkan?

Bekerja dengan Ubuntu 17.04 dan php 7.1

6
Jorge Montoya

Pastikan server web Anda (nginx/Apache) menggunakan versi PHP yang sama dengan versi cli Anda. Misalnya, Anda dapat mengalami masalah ini jika cli PHP = versi PHP 7.1 dan server web Anda menggunakan PHP 7.0.

15
Renrhaf

Untuk Ubuntu 16.04 saya harus menjalankan perintah berikut untuk menyesuaikan versi PHP yang digunakan oleh Apache:

Sudo a2dismod php7.0
Sudo a2enmod php7.2
Sudo service Apache2 restart
7
Juampy NR

Saya menghapus semua dependensi php:

Sudo apt-get remove php*

Saya menginstal php lagi:

Sudo apt-get install php7.1 php7.1-cli php7.1-common libapache2-mod-php7.1 php7.1-mysql php7.1-fpm php7.1-curl php7.1-Gd php7.1-bz2 php7.1-mcrypt php7.1-json php7.1-tidy php7.1-mbstring php-redis php-memcached

Apache yang direstart

Sudo service Apache2 restart

Ada layar instalasi!

3
Jorge Montoya