by David Snopek on February 12, 2019 - 2:26pm

One the most popular articles on our blog is an article I wrote a year and half ago about how to install CiviCRM on Drupal 8.

The method described there worked (and still more-or-less works), but it's... a mess.

It involves running a dozen or so commands, and is pretty easy to get wrong. All of this is just to get code assembled in such a way that you CAN install it.

I'm happy to announce that you can now do this in just a single command!

There's still some little issues and bugs with running CiviCRM on Drupal 8 that need to be manually worked around, but getting over that first hurdle of simply allowing you to install it in the first place should be significantly easier with this new method.

Read the full article to find out how!

Background: Why is this hard?

The biggest problem is that both Drupal 8 and CiviCRM depend on some of the same PHP libraries, for example, Symfony.

In PHP, you can't define the same class twice (this would be a fatal error) and you certainly can't define the same class twice at two different versions (for example, one version for Drupal and one for CiviCRM).

So, you couldn't just copy CiviCRM with all its dependencies into an instance of Drupal, because some of those dependencies would conflict with what's already in Drupal.

And, unfortunately, you couldn't just make a special CiviCRM bundle that's "optimized" for a particular version of Drupal 8, because each Drupal 8 site is potentially unique: you can update the PHP libraries used by a Drupal 8 site (for example, upgrading Symfony to a newer version) or add new PHP libraries that could conflict.

The Magic of Composer

Composer is a tool that's used by PHP applications and libraries to find and download a compatible set of dependencies.

For example, CiviCRM needs Symfony 2 (version 2.8.44 or greater) or any version of Symfony 3. Drupal 8.6.9 needs Symfony 3.4 (version 3.4.14 or newer), although, soon it will be possible to use Drupal 8 with Symfony 4 as well.

Using composer, you can say, "I need Drupal 8.6.9 and CiviCRM 5.10.0" and it can pull in a version of Symfony that works for both.

If your Drupal site used Symfony 4 (because some Drupal module needed it), it would error out and say you need to either remove that module (so Symfony can be downgraded to Symfony 3) or remove CiviCRM.

That's why composer is so heavily involved in getting Drupal and CiviCRM to work together!

The peculiarities of CiviCRM

Of course, that's not the whole problem, because otherwise it would have been possible to solve this with a single composer command years ago.

CiviCRM has been around for over a decade (which is a lifetime ago in the PHP ecosystem), and still has some legacy pecularilies that need to be accounted for..

Namely, CiviCRM depends on going through a non-composer-y build process to generate a "release" that is actually usable.

Some of those things that need a build process could be reworked in a way so that they didn't need it, and others could be done in a composer-compatible way, such that CiviCRM would work like any composer library. Work is being done on that, but those are hard problems which will take time to solve.

TL;DR - What are the commands?

Alert: There are now official CiviCRM docs on how to install CiviCRM on Drupal 8. The instructions here are no longer recommended.

Heh, alright! Time for the actual actionable steps. :-)

First, you need to have the following installed:

And, make sure that you have a recent version of Composer! A couple of people have tried to use this process with older versions and have experienced issues. (In general, you shouldn't be using a composer that's older that 90 days - the Composer eco-system evolves quickly!)

Then, to create a new Drupal 8 site with CiviCRM:

# replace 'some-dir' with the directory to create
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction

Or, to add to an existing Drupal 8 site (assuming you used the best practice method of starting from the drupal-project composer template or the drupal/recommend-project composer template):

composer require civicrm/civicrm-asset-plugin civicrm/civicrm-drupal-8 civicrm/civicrm-packages

If you have a Drupal 8 site that isn't composerized, well, you're going to need to convert your site.

I'd recommend creating a new codebase (using the 'composer create-project' command above), adding all the modules/themes/libraries from the old codebase, and then switching the site to the new codebase. Assuming you didn't forget to copy anything over, that should work, but definitely keep a backup.

Installing CiviCRM

Once you have the code in place using the commands above, you'll actually need to install CiviCRM. Due to some bugs in CiviCRM for Drupal 8, there's a bunch of caveats and extra steps associated with that.

I've documented some of the steps on the project page for 'roundearth/drupal-civicrm-project':

https://gitlab.com/roundearth/drupal-civicrm-project#installing-civicrm

Hopefully, all these bugs will be fixed in time.

The good news is that the composer project template will always pull in the latest versions of CiviCRM and its Drupal 8 integration, so these steps should be able to remain the same, and will just start working better as those bugs get fixed. :-)

How does it work?

There are two parts to this:

It does the following:

  1. Run's Bower to pull in Javascript and CSS dependencies
  2. Downloads a release of CiviCRM and copies in the missing files generated by the usual build process
  3. Downloads any requested CiviCRM extensions
  4. Copies any web assets from CiviCRM (which is installed in the vendor directory, which isn't web accessible) into the web root

In case you're curious, or want to help improve it, here's where all the most interesting code lives:

https://gitlab.com/roundearth/civicrm-composer-plugin/blob/master/src/Handler.php

(UPDATE 2020-04-21: Going forward, please use the civicrm/civicrm-asset-plugin and participate with the CiviCRM community to improve it!)

Conclusion

One of the main challenges in improving CiviCRM on Drupal 8, is just getting it installed for developers who might want to help.

We've been involved in the effort to port the Webform CiviCRM module to Drupal 8, which has also faced this same challenge.

That's why a small part of the development of this new method was funded via the donations that were made to that effort. The rest was just part of our efforts in maintaining Roundearth, a Drupal 8 and CiviCRM platform for non-profits.

We're hoping this will help, not only with getting CiviCRM installed on Drupal 8, but also help to accelerate development. :-)

Want to read more articles like this?

myDropWizard.com blog Subscribe to the myDropWizard.com blog and recieve e-mail updates when new articles are published!

Comments

No, "^8.6.0" is basically the same as saying "8.*" (so it'll update to any version of Drupal 8, but not Drupal 9) with a minimum of at least 8.6.0. So, that constraint shouldn't be preventing the update. Did you try my suggestions in my last comment? If the first doesn't work, the 2nd should give you an error message that explains exactly which constraint is blocking you from updating to 8.8.1

I guess what I'm asking is if we have installed via the recommended method ie

composer create-project roundearth/drupal-civicrm-project:8.x-dev <project-name> --no-interaction

then what is the standard procedure for upgrading Drupal when a new version is released?

It can depend on the specifics of your site, but what I run is:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies --no-dev

This worked:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies

Thanks Mike

FYI - there is a report on chat.civicrm that some additional requires might be required.
(symfony/filesystem:~3 and symfony/finder:~3 )
https://chat.civicrm.org/civicrm/pl/9kocmndhqfrgtq17po33tkix5w

Hm, thanks! I think the thing there is that the 'drupal/recommended-project' composer template locks you into specific versions, which may need to be tweaked for Drupal and CiviCRM to have compatible dependencies. I haven't done much with that template yet, it's pretty new.

I'm sorry, but I can't make heads or tails out of this documentation. I mean this is really, really confusing for someone that doesn't already know all about all the stuff you're talking about. Can you just write up some short instructions for a fresh ubuntu 18 installation?

Hm, starting from a fresh Ubuntu 18.04 installation you'd have to setup the webserver and database and all that stuff too, which is beyond the scope of this little article. :-) Maybe it'd be best for you to Google up some documentation on installing Drupal 8 on a fresh Ubuntu 18.04 installation, and then when you get to the part where they download Drupal, you could just replace it with the 'composer' command given in this article? Setting up Drupal 8 + CiviCRM is basically the same as setting up Drupal 8, there's just some special steps to get the CiviCRM code pulled in, which is what I'm trying to address here.

David, I don't see any comments for several months. Has interest dropped off, or have all hte wrinkles been ironed out where Civi/Drupal is concerned.

I installed Drupal 8.8.2 and got the setting.php file configured optimally, and now think I will just delete that installation and install Civi the way you describe here.

I still see a need for Civi, I have been shopping platform for creating a Constituent Relationship Management system, and haven't found anything that is really compelling. I got hosting where I can create a test environment and then move that to a VPS where it will be able to scale like it needs to scale to accomplish what our group hopes for.

Since it has been a few months since the last comment, is there any recent news that I should consider before committing.

There isn't much news from us, but the CiviCRM community has been doing a ton of Drupal 8 work over the last couple months! They've reworked the way CiviCRM does it's installation in Drupal 8, made an alternative to the plugin I wrote about here, fixed a bunch of bugs, etc. In a few months, there will probably be a new official way to install CiviCRM on Drupal 8 from the project itself, which would be awesome! :-) Once that's out and been tested for a while, we'll probably convert all our sites over to the official stuff.

So, things for CiviCRM on Drupal 8 are only getting better and better. :-)

I need to install Civi now, so is it still acceptable to use the roundearth/drupal-civicrm-project:8.x-dev package you provide on MyDropWizzard and then use Composer with GIT and Bower installed to install that package and then wait for the new Civi installer to become available and then create a new instance of Civi and port the data over a few months down the road?

We are looking at Engage AMS, VeryConnect, Brilliant Directories, eDirectory, Mobilize, Personify360 to get us up and running out of the box. We envision 100,000 users initially and we need to be up an running in a month, and I don't think I can get Civi all fleshed out in that period of time. We realize that as we grow we will run into conflicts with these SaaS solutions and will need to have our own platform dedicated to just our organization, something like Amnesty International. So what I was thinking is that as we build out our AMS/CRM system on whatever platform we choose, that I would be busy creating those same structures in Civi as we go. I realize that what we want to do here is going to beyond what I can do by myself, but initially, until we get investors interested, it is going to be just me.

Any advice you can lend here will be very much appreciated. I hate building things out only to learn later that I have to tear them down and start over.

I need to install Civi now, so is it still acceptable to use the
roundearth/drupal-civicrm-project:8.x-dev package you provide on
MyDropWizard and then use Composer with GIT and Bower installed to install
that package and then wait for the new Civi installer to become available and
then create a new instance of Civi and port the data over a few months down
the road?

Oh yeah, this is still the best option right now, in my opinion. Converting to the new stuff when it's out shouldn't be too tricky - we'll probably post a blog about how to do it. :-)

How can I upgrade my drupal 7 civicrm site to drupal 8 please? Thanks

Hi!

If you make a new Drupal 8 site, moving just the CiviCRM part over from Drupal 7 is actually quite easy. Just install CiviCRM on the Drupal 8 site, and then either (1) move your CiviCRM database into Drupal 8's database, or (2) adjust the civicrm.settings.php to point at your CiviCRM database. Assuming you're using the same version of CiviCRM and copied over all the CiviCRM extensions, it should just work! When we've done this in the past, we first updated CiviCRM on the Drupal 6 or 7 site to match the version we had on the Drupal 8 site, and then copied the database (Drupal 8's CiviCRM integration isn't as well tested with using a seperate database for Civi).

However, any extra integrations may you have between Drupal 7 <-> CiviCRM will need to get recreated in Drupal 8, for example, if you have an Drupal Views that access CiviCRM data, or use Drupal modules that provide deeper integrations like civicrm_webform or civicrm_entity.

I hope that helps!

No, I am creating a new Drupal/CiviCRM site using the latest Drupal/CiviCRM composer project template that is available on MyDropWizzard to do that. I am actually looking at commercially available CRMs to get started, but I want Civi installed so that I c an begin developing it out as I implement features on these commercially available CRM. I need revenue coming in quickly so that I can afford to develop out the Civi instance. Eventually I want Civi to handle Canvassing and Phone Banking as well as tracking legislation on Congress and State legislatures.

I want to say that it was hell getting VPS hosting set up on BlueHost, and it is hell getting domains transferred from GoDaddy to BlueHost, it is like these companies see domain registration management as intellectual property and they don't want you transferring the management of domains away from them. I have done some background reading and I realize that these hosting services have been bought by Venture Capital Companies.

Installing a new Civi following the instructions and getting the following Error:

"Error: Call to undefined method Civi\Setup::getPendingAction() in civicrm_install() (line 17 of /home/newyork/public_d8/web/modules/contrib/civicrm/civicrm.install)."

The tables aren't created and the civicrm.settings.php file doesn't exist either.

Do you know what version of Civi got installed? I think this might be an incompatibility between the civicrm-core library and the 'civicrm' Drupal module that got installed. I haven't had a chance to try installing the latest Civi in a while, which I guess I need to do...

I got the following errors below. Also I am not clear about "some-dir" is that the path to public_html you are looking for, also should I be in that directory when installing. The install didn't work and I got the follow errors and warning. I am going to have to be the kid here that needs to be taught how to do things.

- Installing composer/xdebug-handler (1.4.1): Downloading (0%) Failed to download composer/xdebug-handler from dist: Could not authenticate against github.com
Now trying to download from source
- Installing composer/xdebug-handler (1.4.1): Cloning 1ab9842d69 from cache
- Installing composer/spdx-licenses (1.5.3): Downloading (100%)
- Installing seld/phar-utils (1.1.0): Downloading (100%)
- Installing seld/jsonlint (1.7.2): Downloading (0%) Failed to download seld/jsonlint from dist: Could not authenticate against github.com
Now trying to download from source
- Installing seld/jsonlint (1.7.2): Cloning e2e5d290e4 from cache
- Installing composer/ca-bundle (1.2.6): Downloading (100%)
- Installing composer/composer (1.10.1): Downloading (0%) Failed to download composer/composer from dist: Could not authenticate against github.com
Now trying to download from source
- Installing composer/composer (1.10.1): Cloning b912a45da3 from cache
- Installing instaclick/php-webdriver (1.4.7): Downloading (100%)
- Installing behat/mink-selenium2-driver (1.3.x-dev 0a09c43): Downloading (100%)
- Installing fabpot/goutte (v3.2.3): Downloading (0%) Failed to download fabpot/goutte from dist: Could not authenticate against github.com
Now trying to download from source
- Installing fabpot/goutte (v3.2.3): Cloning 3f0eaf0a40 from cache
- Installing behat/mink-browserkit-driver (v1.3.4): Downloading (0%) Failed to download behat/mink-browserkit-driver from dist: Could not authenticate against github.com
Now trying to download from source
- Installing behat/mink-browserkit-driver (v1.3.4): Cloning e3b9084002 from cache
- Installing behat/mink-goutte-driver (v1.2.1): Downloading (0%) Failed to download behat/mink-goutte-driver from dist: Could not authenticate against github.com
Now trying to download from source
- Installing behat/mink-goutte-driver (v1.2.1): Cloning 8b9ad6d2d9 from cache
- Installing symfony/polyfill-intl-idn (v1.14.0): Downloading (0%) Failed to download symfony/polyfill-intl-idn from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/polyfill-intl-idn (v1.14.0): Cloning 6842f1a39c from cache
- Installing symfony/polyfill-util (v1.14.0): Downloading (0%) Failed to download symfony/polyfill-util from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/polyfill-util (v1.14.0): Cloning ba3cfcea6d from cache
- Installing symfony/polyfill-php56 (v1.14.0): Downloading (100%)
- Installing symfony/http-kernel (v3.4.38): Downloading (100%)
- Installing asm89/stack-cors (1.3.0): Downloading (100%)
- Installing zendframework/zend-diactoros (1.8.7): Downloading (0%) Failed to download zendframework/zend-diactoros from dist: Could not authenticate against github.com
Now trying to download from source
- Installing zendframework/zend-diactoros (1.8.7): Cloning a85e67b86e from cache
- Installing symfony/psr-http-message-bridge (v1.2.0): Downloading (0%) Failed to download symfony/psr-http-message-bridge from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/psr-http-message-bridge (v1.2.0): Cloning 9ab9d71f97 from cache
- Installing masterminds/html5 (2.7.0): Downloading (0%) Failed to download masterminds/html5 from dist: Could not authenticate against github.com
Now trying to download from source
- Installing masterminds/html5 (2.7.0): Cloning 104443ad66 from cache
- Installing egulias/email-validator (2.1.17): Downloading (0%) Failed to download egulias/email-validator from dist: Could not authenticate against github.com
Now trying to download from source
- Installing egulias/email-validator (2.1.17): Cloning ade6887fd9 from cache
- Installing stack/builder (v1.0.6): Downloading (0%) Failed to download stack/builder from dist: Could not authenticate against github.com
Now trying to download from source
- Installing stack/builder (v1.0.6): Cloning a4faaa6f53 from cache
- Installing zendframework/zend-stdlib (3.2.1): Downloading (100%)
- Installing zendframework/zend-feed (2.12.0): Downloading (0%) Failed to download zendframework/zend-feed from dist: Could not authenticate against github.com
Now trying to download from source
- Installing zendframework/zend-feed (2.12.0): Cloning d926c5af34 from cache
- Installing easyrdf/easyrdf (0.9.1): Downloading (100%)
- Installing symfony/routing (v3.4.38): Downloading (0%) Failed to download symfony/routing from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/routing (v3.4.38): Cloning c1377905ed from cache
- Installing symfony-cmf/routing (1.4.1): Downloading (100%)
- Installing doctrine/reflection (1.2.0): Downloading (0%) Failed to download doctrine/reflection from dist: Could not authenticate against github.com
Now trying to download from source
- Installing doctrine/reflection (1.2.0): Cloning b699ecc7f2 from cache
- Installing doctrine/event-manager (1.1.0): Downloading (100%)
- Installing doctrine/cache (1.10.0): Downloading (100%)
- Installing doctrine/persistence (1.3.7): Downloading (0%) Failed to download doctrine/persistence from dist: Could not authenticate against github.com
Now trying to download from source
- Installing doctrine/persistence (1.3.7): Cloning 0af483f91b from cache
- Installing doctrine/inflector (1.3.1): Downloading (0%) Failed to download doctrine/inflector from dist: Could not authenticate against github.com
Now trying to download from source
- Installing doctrine/inflector (1.3.1): Cloning ec3a552422 from cache
- Installing doctrine/common (2.12.0): Downloading (0%) Failed to download doctrine/common from dist: Could not authenticate against github.com
Now trying to download from source
- Installing doctrine/common (2.12.0): Cloning 2053eafdf6 from cache
- Installing typo3/phar-stream-wrapper (v3.1.4): Downloading (0%) Failed to download typo3/phar-stream-wrapper from dist: Could not authenticate against github.com
Now trying to download from source
- Installing typo3/phar-stream-wrapper (v3.1.4): Cloning e0c1b495cf from cache
- Installing symfony/validator (v3.4.38): Downloading (0%) Failed to download symfony/validator from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/validator (v3.4.38): Cloning b5ccfc1adf from cache
- Installing symfony/serializer (v3.4.38): Downloading (0%) Failed to download symfony/serializer from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/serializer (v3.4.38): Cloning f8b99832d0 from cache
- Installing symfony/class-loader (v3.4.38): Downloading (0%) Failed to download symfony/class-loader from dist: Could not authenticate against github.com
Now trying to download from source
- Installing symfony/class-loader (v3.4.38): Cloning bcdf6ff46e from cache
- Installing drupal/core (8.8.4): Downloading (0%) Failed to download drupal/core from dist: Could not authenticate against github.com
Now trying to download from source
- Installing drupal/core (8.8.4): Cloning 34e59fcf70 from cache
- Installing webflo/drupal-core-require-dev (8.8.4)
- Installing vlucas/phpdotenv (v2.6.1): Downloading (0%) Failed to download vlucas/phpdotenv from dist: Could not authenticate against github.com
Now trying to download from source
- Installing vlucas/phpdotenv (v2.6.1): Cloning 2a7dcf7e3e from cache

Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package katzien/php-mime-type is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package webflo/drupal-core-require-dev is abandoned, you should avoid using it. Use drupal/core-dev instead.

The messages like this:

Downloading (0%) Failed to download symfony/class-loader from dist: Could not authenticate against github.com

... are just a composer/github thing. GitHub limits how many API requests you can make without being authenticated. Here's an article about how to set that up:

https://www.previousnext.com.au/blog/managing-composer-github-access-personal-access-tokens

I'll address the other bit in response to your next comment...

I got Drupal/Civi uploaded and ready to install with the following exceptions

Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package katzien/php-mime-type is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package webflo/drupal-core-require-dev is abandoned, you should avoid using it. Use drupal/core-dev instead.

Is this going to be a problem and is there a composer way to add these? Is there anything I need to do at this point before going to the installation.

Those libraries, which are Drupal dependencies, have changed their names. At the moment, this won't cause any problems, because the libraries are basically the same, just under the new name. At some point in the future, there could be a security release that is only under the new name or something like that, where being on the old name will be a problem. But before that happens, I'm sure Drupal will update it dependencies to point at the new names, and you won't personally have to deal with that, so long as you keep up with Drupal updates.

I hope that makes sense!

Hey,

Looks like the install process might currently be broken due to pulling in civicrm/civicrm-drupal-8 dev-master and civicrm/civicrm-core stable.

The problem occurs on drush en civicrm which yields an error

"Call to undefined method Civi\Setup::getPendingAction()"

cv core:install --cms-base-url="url" seems to work.

I've listed the relevant commits here: https://chat.civicrm.org/civicrm/pl/669t1pnqctnoty4gm4ti7p1n9w

Thanks. I want to get up and going ASAP, so I appreciate all the help. I will try all the suggestions here and hopeful there will be a Drop icon on the homepage and when I log into administrator, I will see the Civi panel.

I am also going to install MediaWiki in a sub domain with it's own database. This is more straight forward as it is a stand alone application.
I want to make items in MediaWiki available to Drupal/CiviCRM, however. Expect that will be a lot of work.

The consolidation of resources, both physical and digital, into a few hands, is moving forward very rapidly right now. Getting this up is now more important than ever to me because we need independent voices to persist on the Internet. Actually we need the internet to remain the internet, not become a broadcasting system where only licensed broadcasters are allowed access to publish content; in some circles, that idea is already in the works, justified by the outbreak of COVID-19, because, as it is suggested, we need a unified coordinated voice on the Internet to deal with crisis.

I think you're right, however, now that civicrm-core 5.24.0 has been released, they should work together again! I'm going to see if I can update the template and documentation so you end up with a release version of the module, rather than dev-master, though, so this doesn't come up again.

Hi David,
I have tried to install in a shared hosting (a2hosting) with php 7.1 by SSH

when i enter the command:

composer create-project roundearth / drupal-civicrm-project: 8.x-dev drupal-civicrm --no-interaction

tells me that:

[email protected] [~]# composer -V
Composer version 1.10.1 2020-03-13 20:34:27
[email protected] [~]# bower --version
1.8.8
[email protected] [~]# git --version
git version 2.23.0
[email protected] [~]# composer create-project roundearth/drupal-civicrm-project:8.x-dev drupal-civicrm --no-interaction
Creating a "roundearth/drupal-civicrm-project:8.x-dev" project at "./drupal-civicrm"
Installing roundearth/drupal-civicrm-project (8.x-dev adb1bd6ca0b5df8a6c655dfb0f3c50dad91dfcea)
- Installing roundearth/drupal-civicrm-project (8.x-dev adb1bd6): Cloning adb1bd6ca0 from cache
Created project in /home/demosah1/drupal-civicrm
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information Updating dependencies (including require-dev)
Killed

and it doesn't download the files and folders in the directory.

I think the clue here is this line from your output:

Killed

I don't know for sure, but I suspect your hosting environment has something setup where it'll kill any process that runs for longer than a maximum number of seconds. I'd recommend contacting support at a2hosting and asking if they do something like that.

If so, one possibility is running the composer command locally and then uploading the resulting files.

I have had to increase my php memory to 3072 temporarily to have Composer do it's thing.

Hello David,

I'm running a localhost with Ubuntu20.04(beta)/Apache2/MySQL 8.0.19/PHP 7.4.3/Composer1.10.5/Drupal 8.8.5.
I followed the installation guide here (https://www.drupal.org/docs/develop/local-server-setup/linux-development...), using
$ composer create-project drupal-composer/drupal-project:8.x-dev example.localhost --no-interaction
so I should have the same as you recommended.
When I am in my directory var/www/html/example.localhost/ and run
$ composer require roundearth/civicrm-composer-plugin civicrm/civicrm-drupal-8
then I get the following error:
--------------Error Message----------------------------
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for pear/pear_exception (locked at v1.0.1, required as ^1.0) -> satisfiable by pear/pear_exception[v1.0.1].
- civicrm/civicrm-drupal-8 5.24.0 requires civicrm/civicrm-core >=5.21.0 -> satisfiable by civicrm/civicrm-core[5.21.0, 5.21.1, 5.21.2, 5.21.x-dev, 5.22.0, 5.22.1, 5.22.x-dev, 5.23.0, 5.23.1, 5.23.2, 5.23.3, 5.23.4, 5.23.x-dev, 5.24.0, 5.24.1, 5.24.2, 5.24.x-dev, 5.25.x-dev, dev-master].
- civicrm/civicrm-drupal-8 5.24.1 requires civicrm/civicrm-core >=5.21.0 -> satisfiable by civicrm/civicrm-core[5.21.0, 5.21.1, 5.21.2, 5.21.x-dev, 5.22.0, 5.22.1, 5.22.x-dev, 5.23.0, 5.23.1, 5.23.2, 5.23.3, 5.23.4, 5.23.x-dev, 5.24.0, 5.24.1, 5.24.2, 5.24.x-dev, 5.25.x-dev, dev-master].
- civicrm/civicrm-drupal-8 5.24.x-dev requires civicrm/civicrm-core >=5.21.0 -> satisfiable by civicrm/civicrm-core[5.21.0, 5.21.1, 5.21.2, 5.21.x-dev, 5.22.0, 5.22.1, 5.22.x-dev, 5.23.0, 5.23.1, 5.23.2, 5.23.3, 5.23.4, 5.23.x-dev, 5.24.0, 5.24.1, 5.24.2, 5.24.x-dev, 5.25.x-dev, dev-master].
- civicrm/civicrm-drupal-8 5.25.x-dev requires civicrm/civicrm-core >=5.21.0 -> satisfiable by civicrm/civicrm-core[5.21.0, 5.21.1, 5.21.2, 5.21.x-dev, 5.22.0, 5.22.1, 5.22.x-dev, 5.23.0, 5.23.1, 5.23.2, 5.23.3, 5.23.4, 5.23.x-dev, 5.24.0, 5.24.1, 5.24.2, 5.24.x-dev, 5.25.x-dev, dev-master].
- civicrm/civicrm-core 5.21.0 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.21.1 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.21.2 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.21.x-dev requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.22.0 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.22.1 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.22.x-dev requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.0 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.1 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.2 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.3 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.4 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.23.x-dev requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.24.0 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.24.1 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.24.2 requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.24.x-dev requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core 5.25.x-dev requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- civicrm/civicrm-core dev-master requires pear/log 1.13.1 -> satisfiable by pear/log[1.13.1].
- Conclusion: don't install civicrm/civicrm-drupal-8 5.24.2|install pear/log 1.13.1
- pear/log 1.13.1 requires pear/pear_exception 1.0.0 -> satisfiable by pear/pear_exception[v1.0.0].
- Conclusion: don't install pear/pear_exception v1.0.0
- Installation request for civicrm/civicrm-drupal-8 ^5.24 -> satisfiable by civicrm/civicrm-drupal-8[5.24.0, 5.24.1, 5.24.2, 5.24.x-dev, 5.25.x-dev].
Installation failed, reverting ./composer.json to its original content.
-----------------------------------------------------

I tried to understand what is the problem with pear/pear_exception (using composer why, why-not, then I removed and required the package again... no chance). Actually, I do not understand from the above error, if I need version v1.0.0 (it says "Installation request for pear/pear_exception (locked at v1.0.1, required as ^1.0) ") or rather v.1.0.1 ("Conclusion: don't install pear/pear_exception v1.0.0")

I would be really happy if you could help me solving this problem.

Best regards,
Elke

Yeah, I know this output is super tricky to understand. From my reading of the output, it sounds like pear/log 1.13.1 requires pear/pear_exception 1.0.0, but your already locked on pear/pear_exception 1.0.1. So, I'd try doing:

composer require pear/pear_exception:1.0.0

... and then try your last command again. Hopefully, that'll help!

The composer commands worked now, thank you :-D

When installing CiviCRM Core and Theme under admin/modules, I had short trouble due to missing write permissions for two file paths. I added them manually with chmod a+w <foldername> and I have removed them again after the installation was completed.

However, CIVICRM does not seem to have installed properly, there is only a CiviCRM Icon but no submenu appearing and the configuration page is empty. The Theme does not appear to be installed.

I'll try it again these days, maybe you have an idea what is wrong?

Thank you a lot and best regards,
Elke

Need to find a better host.

I was on my way, all warnings satisfied, Got the domain pointed to public_html/web and had completed the first round of prompts and just needed to create a database and give it to the drupal-civicrm-project:8 script to complete the setup and install Drupal/CiviCRM. Then everything came to a screeching halt. I suddenly discovered I could not log into the BlueHost database manager to to create the database. phpMyAdmin had database creation disabled, WHM manager also had database management disabled. I have been working with BlueHost technical support for a couple of days, but they don't seem to understand what the problem could be.

Does anyone have a suggestion for a good host. I don't want shared hosting, I want VPS, Dedicated Server, or something like Acquia has but I would like to stay as far away from Google and Amazon as I can. I have one possibility in mind, OVHCloud, but I don't know what kind of Drupal support they provide. They have bare metal servers for lease so I guess I could install anything I needed there, composer, bower, git, drush along with Linux, Apache, MySQL, PHP and anything else. Acquia is compelling, but they are on AWS and I don't want to support Jeff Bezos in any way shape or form, neither do I want to support Google. Acquia allows for a local dev environment where work on the local environment can be seamlessly pushed to the live server which is really nice, If only they didn't decide to host on AWS.

Any suggestions would be really appreciated, even suggestions that perhaps I am too paranoid about AWS, but I have to tell you that I just don't trust Bezos, he is in his own myopic world of space colonies for the masses and I don't think that is good.

I can't speak to Drupal support (because we just launch servers and then our own Drupal setup) but we use a mix of OVH and Linode for our VPS and dedicated servers. Pantheon and Omega8.cc provide great Drupal-specific hosting solutions, which we also use, when not looking for VPS or dedicated server.

I tried to install it this way, after enabling civicrm module, I don't get any errors, but I don't see anything on the dashboard and in the footer, the system status is error.
I don't know where to start looking

It could be related to some new settings that need to be added to civicrm.settings.php since 5.23.0. Some notes were recently added to the README for on the GitLab project for this:

https://gitlab.com/roundearth/drupal-civicrm-project/-/blob/8.x/README.md#installing-civicrm

See step nr 4 under "Installing CiviCRM":

4. Add the following to civicrm.settings.php:

// Recommended for all versions:
$civicrm_setting['domain']['userFrameworkResourceURL'] = '[cms.root]/libraries/civicrm';
// Required for CiviCRM 5.23+
$civicrm_paths['civicrm.root']['url'] = '/libraries/civicrm/';
$civicrm_paths['civicrm.packages']['url'] = '/libraries/civicrm/packages/';

I hope that helps!

Hi, It helped a lot!!
Now I can go to the configuration page, but I still see some errors:

System Status: Critical
CiviCRM Security Patch Needed
Cron Not Running
Configure Default Mailbox
Complete Setup

Thanks

Awesome! The "Security Patch" one means you need to update to a newer version of CiviCRM, but that's just 'composer update civicrm/civicrm-core --with-dependencies'. But the rest of those errors are just normal CiviCRM configuration stuff, so you can checkout the Civi docs and community for that.

Hello, and thank you for your work. I am wondering how Roundearth runs CiviCRM cron?

With Drupal 8.8.5 and CiviCRM 5.24.2, wiht 'cv' installed for running cron, which I read hear is the only way to have cron working, I am getting a sympony error.

First I make it possible for cv to find civicrm.settings.php
export CIVICRM_SETTINGS=/home/domain/path/web/sites/default/civicrm.settings.php

/opt/cpanel/ea-php73/root/usr/bin/php /usr/local/bin/cv api job.execute --user=cronuser --cwd=/home/domain/path/web

[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined function drupal_get_user_timezone()

Would this be a novel incompatibility, or am I doing something wrong?

Much appreciating your help.

For sites where we don't have much control over the server (ie. on Pantheon) we use the civicrm_cron module to run Civi's cron at the same time that Drupal's runs:

https://www.drupal.org/project/civicrm_cron

And for sites where we have do have more server control, we use 'drush cvapi job.execute' rather than doing it via 'cv' which we're less familiar with than Drush. Since we don't really use 'cv', I'm not sure if your error is common or not.

Thank you David for sharing your trade secrets!

To go with drush cvapi, I see I have to figure out how make drush aware of cvapi, for at the moment I am getting "Command "cvapi" is not defined". Or maybe I will go and try out the civicrm_cron. I was a bit averse to it being somewhat old alpha code, but beggars cannot be choosers.

Cheers.

If you're using Drush 8 and have the 'civicrm' module enabled, you should have 'drush cvapi'. If you're not seeing it, it's probably because you're using Drush 9 - the 'civicrm' module hasn't yet added support for Drush 9.

Got it - drush 8, thank you David.
Right now it is drush 10.2 that composer is installing when no version is indicated.

I finally got Drupal/CiviCRM installed without warnings or errors.
However, when opening the Cnfiguration panel, three errors appeared.
1. I had not set
$settings['trusted_host_patterns'] = [
'^www\.example\.com$',
];
In /web/sites/default/setting.php, so I went ahead and enabled that in settings

2 I had not set permission for settings.php to 444, so I did a chmod ugo=r settings.php

3. I had not set the permissions for the default directory to 555., so I did a chmod ugo=rx default

And when I looked the seeting were correct.

After I did these thing I got the following error when trying to log in:

Actually I seemed to be logged in right now, so let me try accessing the Configuration Menu.

Ahhh, I get

Access denied
You are not authorized to access this page.

An if I now try to log in, I get the following message:

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

And I am stuck here. Not sure what to do. I have entered a comment on the Drupal forum, but there has been no response yet.

Wanted to Add Additional Information:

These are comments made on the Drupal Forum.

I get this error when attempting to log into the Drupal back end.

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

* Sounds like it is not enabled. Your environment probably needs to have the RewriteBase / enabled in .htaccess.

Thanks for the suggestions, they seemed like the answer to my problem, but evidently it is something else.

Here is a thought, in the Apache httpd.conf file DoceumentRoot is set to DocumentRoot /home/myaccount/public_html, but the domain is pointed to public_html/web should I add entries in the Apache configuration override files to reflect this, such that every instance of DocumentRoot /home/ptqeiamy/public_html should be changed to DocumentRoot /home/ptqeiamy/public_html/web. Apache suggest this for making any changes to httpd.conf

# Administrator locations for safely altering virtualhost configuration
/etc/apache2/conf.d/includes/post_virtualhost_global.conf

# Major Version Specific
/etc/apache2/conf.d/includes/post_virtualhost_2.conf

So should I entries for DocumentRoot in one of those files?

*The RewriteBase should be consistent with DocumentRoot of the domain. When the domain points DocumentRoot to ..../web it should be RewriteBase /. Which is the default, but it looks like you need it explicitly. When domain points to .../public_html it needs RewriteBase /web.

*Normally, there are VirtualHost definitions that point DocumentRoot correctly. Consider pointing to .../web correct for a Drupal site. Most people prefer https://domain to https://domain/web. Obviously, assuming you set up your project with a web folder to restrict what is available through HTTPS.

Of course this is what the MyDropWizzard script did, and I was just along for the ride.

The domain point to home/myaccount/public_html/web. So according to the discussion on Drupal Forum, I should enter RewriteBase / in .htaccess, not RewriteBase /web.

However that doesn't matter, I still get the message
"Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it."
when attemping to log into https://www.mydomain.tld/user/login.

So I am still puzzled.

Yeah, that sounds like some issue with getting your hosting and Drupal 8 configured to work together correctly. I don't really have any suggestions beyond what you already tried. :-(

I'm trying to update my roundearth based site to include a security release for Drupal (v 8.8.6). But getting:

composer update drupal/core-recommended
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Package "drupal/core-recommended" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update

Can you help please?

It sounds like you're using an older version of the template. Try this:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies --no-dev

Killed message
Thanks a lot David for the method.
When following your steps, I get a "killed" message after running the command:
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction

Here is the message I get:
Updating dependencies (including require-dev)
Killed

Looking for an explanation it seems that the process is consuming too much memory and that the solution is either to create a swap file or to upgrade droplet... but I am really not sure what to do.
Do you have any clue and solution for this?
Thank you very much for your support.

Hm. In that case, I'd recommend running composer locally, and then copying the files over to the server. The only possible hiccup with that is differences in PHP version between your local and remote environments. If they aren't the same, you can work around that by changing your composer.json (after it gets created) to say what version of PHP you are targeting. Here's an article about that:

https://andy-carter.com/blog/composer-php-platform

Then running 'composer update' should update the packages with that PHP version in mind.

I hope that helps!

Add comment

o