Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Drupal8 + CiviCRM install notes
Using php 7.1, drupal 8.6.4, civicrm 5.8.2
Set max_execution_time to 0 in php.ini. Restart httpd. (Not required on a server, but on my dev laptop 30 seconds isn't even close to enough for either the drupal or civicrm installation parts.)
Install git.
* Might be obvious, but it's not actually mentioned anywhere.
* Also if you're on windows make sure your PATH can reach both the php executable and git.
Install composer.
Install nodejs. (Yeah, it's required at the moment since bower requires it.)
Install bower via npm.
* If you're on windows make sure your PATH is set up correctly before running this command so it installs the bower module in the right place. e.g. open a new cmd window to do this AFTER installing nodejs.
Follow the instructions at
* When following the gist at, on windows rather than fiddle with "sed" you can just edit civicrm-version.php and change Drupal to Drupal8 manually.
* Note also I think all the comments at that gist have been incorporated into the procedure already.
* I used a slightly different command to install the actual civicrm drupal 8 module: "git clone -b 5.8 civicrm". I was installing civicrm 5.8.2 so I also chose branch 5.8 of the module.
Follow the instructions at, except:
* When it says "webroot", this could mean a couple things. For me I chose the folder that drupal was installed in.
* The "script on the ticket" doesn't work on windows. While most of it is straightforward to do manually, for the rsync command you can use:
`cd vendor\civicrm\civicrm-core`
`xcopy /S *.html \path\to\libraries\civicrm`
`xcopy /S *.js \path\to\libraries\civicrm`,
... and then repeat and replace *.html with each of the file extensions listed in the rsync command, e.g. *.css, *.svg, etc.
* I didn't care about "extern" scripts here, so I just created the one settings_location.php script under libraries/civicrm.
* Also just to get it running I didn't need the part about images in ckeditor.
To get unit tests running with the included vendor/phpunit need to install an older version of dbunit:
* From the drupal root folder: composer require phpunit/dbunit:2.0.3
* Then run tests from the vendor/civicrm/civicrm-core folder: php ../../phpunit/phpunit/phpunit tests/phpunit/whatever
* (Lots of deprecation warnings when running tests, but otherwise seems to work.)
This also works to upgrade.
* Log in as an admin to the existing site. Stay logged in.
* Start at where it says about upgrading (composer require ...) and then repeat everything, except:
Can keep the settings_location.php that's already in libraries/civicrm, and the existing civicrm.settings.php file (unless there's changes needed to it).
For the civicrm-drupal-8 module part, can just do git checkout in that folder to switch branches, e.g. if upgrading to 5.9.x can do `git checkout 5.9`.
* Then at the end visit /civicrm/upgrade?reset=1 in the browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment