Skip to content

Override paths

CiviCRM tries to calculate the correct path and URL for a number of system folders. Sometimes it cannot calculate them correctly. System administrators can override these path variables in the CiviCRM settings file.

Acceptable paths

The following paths can be overridden in civicrm.settings.php:

  • civicrm.log - Path to the directory where CiviCRM is to store its log files - default: [civicrm.private]/ConfigAndLog
  • civicrm.private - Location where private CiviCRM files, such as log files, should be stored. By default, this is the civicrm folder in the upload files directory of your CMS.
  • civicrm.compile - Location of the Smarty compile directory - default: [civicrm.private]/templates_c
  • civicrm.packages - Location where CiviCRM 3rd party packages are installed - default: [civicrm.root]/packages
  • civicrm.bower - Location where the 3rd party Javascript code is installed - default: [civicrm.root]/bower_components/
  • civicrm.files - Location where CiviCRM upload files are stored.
  • civicrm.root - Location of the civicrm library code.
  • civicrm.l10n - Location of the CiviCRM l10n directory - default: [civicrm.root]/l10n

Override paths in civicrm.settings.php

To override paths within your civicrm.civicrm.php you need to include code like. You can override one or both of the 2 path variables either the system path or the url to find the contents.

phpglobal $civicrm_paths;$civicrm_paths['civicrm.packages']['path'] = '/var/www/testing/vendor/civicrm/civicrm-packages/';$civicrm_paths['civicrm.packages']['url'] = 'https://example.com/vendor/civicrm/civicrm-packages/';