CiviCRM for Drupal 8 installation notes » History » Version 8
Jon Goldberg, 03/07/2019 09:09 PM
| 1 | 5 | Jon Goldberg | {{last_updated_at}} by {{last_updated_by}} |
|---|---|---|---|
| 2 | 1 | Jon Goldberg | # CiviCRM for Drupal 8 installation notes |
| 3 | |||
| 4 | 8 | Jon Goldberg | * Make sure your composer version is up to date! The one that ships with civicrm-buildkit is quite old. |
| 5 | * Run the composer command on [David Snopek's blog post](https://www.mydropwizard.com/blog/better-way-install-civicrm-drupal-8) that fits your scenario (creating a new site vs. adding Civi to an existing D8 site). |
||
| 6 | * New site is: `composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction` |
||
| 7 | * Add the following to `civicrm.settings.php` (modify the last line for your actual CMS root, and paste this after `CIVICRM_UF_BASEURL` is defined): |
||
| 8 | 1 | Jon Goldberg | |
| 9 | 8 | Jon Goldberg | ```php |
| 10 | $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/'; |
||
| 11 | $civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/'; |
||
| 12 | $civicrm_setting['domain']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/'; |
||
| 13 | $civicrm_paths['cms.root']['path'] = '/home/jon/local/drupal8test/web'; |
||
| 14 | 2 | Jon Goldberg | ``` |
| 15 | 8 | Jon Goldberg | * If you prefer separate Drupal and Civi databases, [dump the Civi tables only](https://stackoverflow.com/a/5269543/2832108) and [drop the Civi tables](https://stackoverflow.com/a/1589324/2832108). Load them into a new database and modify your `CIVICRM_DSN` in `civicrm.settings.php` accordingly. |
| 16 | 1 | Jon Goldberg | |
| 17 | 8 | Jon Goldberg | #### kcfinder |
| 18 | |||
| 19 | [Note that I have an [open MR](https://gitlab.com/roundearth/civicrm-composer-plugin/merge_requests/1) to handle the first two steps in `civicrm-composer-plugin`. |
||
| 20 | kcfinder (image browsing/upload within CKEditor) is currently broken. You need to do several things to fix. |
||
| 21 | * First, copy it to libraries/civicrm: `cp -r vendor/civicrm/civicrm-core/packages/kcfinder web/libraries/civicrm/packages/`. |
||
| 22 | * Your `<webroot>/libraries/civicrm/settings_location.php` must contain the correct path to the directory which contains `civicrm.settings.php`. |
||
| 23 | * Modify `<webroot>/libraries/civicrm/packages/kcfinder/integration/civicrm.php`. |
||
| 24 | 4 | Jon Goldberg | At line 60, add: |
| 25 | |||
| 26 | ```php |
||
| 27 | case 'Drupal8': |
||
| 28 | $auth_function = 'authenticate_drupal8'; |
||
| 29 | break; |
||
| 30 | ``` |
||
| 31 | 8 | Jon Goldberg | * Finally, add an `authenticate_drupal8` function. You can find some at https://lab.civicrm.org/dev/drupal/issues/42. |
| 32 | 4 | Jon Goldberg | |
| 33 | 8 | Jon Goldberg | #### non-bootstrap scripts |
| 34 | 5 | Jon Goldberg | |
| 35 | 8 | Jon Goldberg | * To get `extern` scripts and `bin/csv/import.php` loading correctly, run this (to create a *second* `settings_location.php`): |
| 36 | 5 | Jon Goldberg | |
| 37 | 8 | Jon Goldberg | ```bash |
| 38 | cat << EOF > vendor/civicrm/civicrm-core/settings_location.php |
||
| 39 | <?php |
||
| 40 | 5 | Jon Goldberg | |
| 41 | 8 | Jon Goldberg | define('CIVICRM_CONFDIR', '../../../web/sites'); |
| 42 | EOF |
||
| 43 | 1 | Jon Goldberg | ``` |
| 44 | 8 | Jon Goldberg | |
| 45 | Alternatively, set BOTH `settings_location.php` values to an absolute path, e.g. `/home/jon/local/agbud8/htdocs/web/sites/default`. |