How can I modify the CiviCRM settings file so that the CiviCRM extension directory is set using settings files variables. Thanks!

1 Answer 1


You can use $civicrm_setting variable to over-ride your CiviCRM settings. You can find documentation here.

To set extension directory you can use below snippet

global $civicrm_setting;
$civicrm_setting['Directory Preferences']['extensionsDir'] = '/var/www/html/trcbtp/drupal/sites/default/civicrm_extensions';

You can also use civicrm token variable for dynamic path

1. [cms.root]
2. [civicrm.root]
3. [civicrm.files]



  • Can I run that command on the command line of my web server? Thanks Oct 8, 2018 at 14:26
  • What command? Do you mean the command to append the line in civicrm.settings.php? Oct 8, 2018 at 14:40
  • Yup Pradeep. Sorry coz I am new to this one. That's why. Thanks. Oct 8, 2018 at 15:09
  • Yes, You can use commands to append the line. Oct 8, 2018 at 15:16
  • Hi Pradeep, do you know a a sample of video tutorial for this one? So that I can see the step-by-step procedure? Thanks so much! Oct 9, 2018 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.