Error installing CiviCRM

Following the amazing work @david-snopek posted:

I spent the better part of last evening trying to get CiviCRM up and running on a Drupal 8.4 BLT project.

After trying a few different approaches, unfortunately I’m now seeing the following error when trying to enable the CiviCRM Core Module

CiviCRM must be downloaded into the libraries folder.

No matter what I try, I can’t seem to get the module to recognize that civicrm is installed.

Other things I’ve tried:

  1. manually copying the [project_root]/vendor/civicrm-core into [project_root]/docroot/libraries/civicrm-core
  2. Renaming libraries/civicrm-coreto libraries/civicrm
  3. Modifying composer.json to try and install CiviCRM into the libraries folder:
  4. Creating symbolic links to the folder (my least favorite attempt)

Here is the composer.json update for number 3 above:

    "require": {     "acquia/blt": "^8.3",     "phpoffice/PHPWord": "dev-zend-version as 0.13.0",     "civicrm/civicrm-core": "4.7.25" }, 

"repositories": {     "phpword": {         "type": "vcs",         "url": "https://github.com/dsnopek/PHPWord.git"     },     "zetacomponents-mail": {         "type": "vcs",         "url": "https://github.com/civicrm/zetacomponents-mail.git"     },     "civicrm": {         "type": "package",         "package": {             "name": "civicrm/civicrm-core",             "version": "4.7.25",             "type": "drupal-library",             "source": {                 "url": "https://github.com/civicrm/civicrm-core.git",                 "type": "git",                 "reference": "origin/master"            }         }     } } 

source: https://gist.github.com/mortenson/a5390d99013b5b8c0254081e89bb4d47

I think this has to do with an autoloader issue perhaps seeing that BLT does not use the Drupal composer.json file and the instructions @david-snopek posted were for the traditional Drupal installation method.

I was able to trace the error to modules/custom/civicrm-drupal/civicrm.install:125.

/**  * Returns the path to where CiviCRM is installed.  *  * @return string|void  *  * Recommended location for civicrm is in /libraries/civicrm [citation needed].  * We also allow /modules/civicrm, which seems to work fine.  */ function _civicrm_find_civicrm() {   if ($path = drupal_get_path('module', 'civicrm')) {     if (file_exists($path . '/CRM/Core/ClassLoader.php')) {       return Drupal::service('file_system')->realpath($path);     }   }    $path = 'vendor/civicrm/civicrm-core';   if (file_exists($path . '/CRM/Core/ClassLoader.php')) {     return Drupal::service('file_system')->realpath($path);   }    return NULL; } 

Notes on my process:

I ran into a couple snags with the Gist David posted.

  1. When running $ composer require 'phpoffice/PHPWord:dev-zend-version as 0.13.0', I noticed that Composer was trying to add the dependency as:

    "require": {     "phpoffice/PHPWord": "dev-zend-version",     "as 0.13.0" }, 

This failed but I was able to get past the issue by manually adding the dependency to the composer.json file as:

    "require": {         "acquia/blt": "^8.3",         "phpoffice/PHPWord": "dev-zend-version as 0.13.0",     }, 

Unfortunately, I then got stuck on the next step requiring civicrm-core until I read the comment a bit closer. I believe this step is now incorrect as civicrm-core 4.7.25 has been released.

#Require civicrm-core at the requested version. #TODO: Need to keep using my fork until 4.7.25 is released! #composer require civicrm/civicrm-core:$CIVICRM_VERSION composer require "civicrm/civicrm-core:dev-roundearth-$CIVICRM_VERSION as $CIVICRM_VERSION" 

I was able to get past that issue by updating the additional repository via: composer config repositories.civicrm-core vcs https://github.com/civicrm/civicrm-core.git

Reference: https://www.mydropwizard.com/blog/how-install-civicrm-drupal-8-and-why-choose-it-over-pure-drupal-crm

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Error installing CiviCRM

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.