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


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]



| improve this answer | |
  • Can I run that command on the command line of my web server? Thanks – santiagoelie Oct 8 '18 at 14:26
  • What command? Do you mean the command to append the line in civicrm.settings.php? – Pradeep Nayak Oct 8 '18 at 14:40
  • Yup Pradeep. Sorry coz I am new to this one. That's why. Thanks. – santiagoelie Oct 8 '18 at 15:09
  • Yes, You can use commands to append the line. – Pradeep Nayak Oct 8 '18 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! – santiagoelie Oct 9 '18 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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