Project

General

Profile

CiviCRM for Drupal 8 installation notes » History » Revision 13

Revision 12 (Jon Goldberg, 04/13/2019 10:53 PM) → Revision 13/24 (Jon Goldberg, 04/18/2019 03:15 PM)

{{last_updated_at}} by {{last_updated_by}} 
 # CiviCRM for Drupal 8 installation notes 

 * Make sure your composer version is up to date!    The one that ships with civicrm-buildkit is quite old. 
 * 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). 
  * New site is: `composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction` 
 * 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): 

 ```php 
 $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';                                                                                                      
 $civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/'; 
 $civicrm_setting['domain']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/'; 
 $civicrm_paths['cms.root']['path'] = '/home/jon/local/drupal8test/web'; 
 ``` 
 * 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. 

 #### kcfinder 

 [Note there is an [merged [open MR](https://gitlab.com/roundearth/civicrm-composer-plugin/merge_requests/2) to handle the first two steps in `civicrm-composer-plugin` but it's not published to packagist yet.    The `civicrm-composer-plugin`, and the third step should be included in Civi 5.13.] 
 kcfinder (image browsing/upload within CKEditor) is currently broken.    You need to do several things to fix. 
 * First, copy it to libraries/civicrm: `cp -r vendor/civicrm/civicrm-core/packages/kcfinder web/libraries/civicrm/packages/`. 
 * Your `<webroot>/libraries/civicrm/settings_location.php` should read: 

 ```php must contain the correct path to the directory which contains `civicrm.settings.php`. 
 <?php 

 define('CIVICRM_CONFDIR', dirname(dirname(dirname(__FILE__))) . '/sites'); 
 ``` 

 * Apply [this PR](https://github.com/civicrm/civicrm-packages/pull/242) to `<webroot>/libraries/civicrm/packages/kcfinder/integration/civicrm.php`. 

 

 #### non-bootstrap scripts 

 [There's an [open MR](https://gitlab.com/roundearth/civicrm-composer-plugin/merge_requests/4) to handle this] 

 * To get `extern` scripts and `bin/csv/import.php` loading correctly, run this (to create a *second* `settings_location.php` in `vendor/civicrm/civicrm-core`: `settings_location.php`): 

 ```php ```bash 
 cat << EOF > vendor/civicrm/civicrm-core/settings_location.php 
 <?php 

 define('CIVICRM_CONFDIR', dirname(dirname(dirname(__FILE__))) . '/sites'); 
 EOF 
 ``` 

 Alternatively, set BOTH `settings_location.php` values to an absolute path, e.g. `/home/jon/local/agbud8/htdocs/web/sites/default`.