I have a dev copy of CiviCRM that I upgraded to 4.7.21. The file paths have been removed and show [civicrm.files] instead. I cannot figure out how to set [civicrm.files] so that CiviCRM can see the extend directory and other files.


1 Answer 1


You can specifically set the value of [civicrm.files] in civicrm.settings.php with code like this:

global $civicrm_paths;
$civicrm_paths['civicrm.files'] = array(
  'url' => 'https://example.com/foo',
  'path' => '/var/www/example.com/foo',

If you don't set the value, then Civi will try to find it automatically, but this doesn't work in all configurations. (For example, if your directory structure uses symlinks, it may not resolve correctly.)

Tip: You didn't ask, but if your system is basically working, then you can inspect the value of [civicrm.files] in a few ways:

  • In the web UI, navigate to Administer => System Settings => Directories. Click on the main help icon.
  • In the web UI, navigate to Administer => System Settings => Resource URLs. Click on the main help icon.
  • In the CLI, run cv path -d [civicrm.files]
  • In the CLI, run cv url -d [civicrm.files]
  • Thanks for this Tim! CiviCRM on the System Status page suggests to me that I should make my resource URLs portable but the documentation says it should be absolute. Does it matter?
    – themak
    Jul 13, 2017 at 18:52
  • Tim, thanks for the great answer. I guess the plot thickens when CV reports I have the right paths.
    – Josh
    Jul 13, 2017 at 20:29
  • If you can use variables like [civicrm.files], I'd say do that. I'm not sure which doc recommends abslute, but I'd guess it was written before 4.7.0. TBH, it's as much taste/circumstance as anything.
    – Tim Otten
    Jul 14, 2017 at 3:58
  • I found that even though the paths were correct according to the CV command I still had to use the code above. Also, I found that CiviCRM was adding /ext and my path was /extend.
    – Josh
    Jul 15, 2017 at 1:12

Your Answer

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

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