When you are troubleshooting a technical issue in CiviCRM, you will frequently see advice telling you to "check your CiviCRM logs" or "clear your template cache." These are essential steps for any administrator or developer, but if you are new to the platform, finding these specific folders can be a challenge.
In CiviCRM, the two most critical directories for maintenance and debugging are ConfigAndLog and templates_c. The ConfigAndLog directory contains the detailed error logs that tell you exactly why a contribution failed or a scheduled job didn't run. The templates_c directory stores compiled Smarty templates; clearing this folder is often the first step in fixing a "White Screen of Death" or a layout that refuses to update after a configuration change.
In this guide, we will break down exactly where these directories live across different Content Management Systems (CMS) and how you can access them even if you don't have direct server access.
Why These Directories Matter for CiviCRM Health
Before we dive into the file paths, it is important to understand what these folders do.
The ConfigAndLog Directory
This is the heartbeat of your debugging efforts. Inside this folder, you will find files named something like CiviCRM. [unique_id].log. These files record PHP errors, database failures, API calls, and payment processor responses. If a user reports an "unrecoverable error," the specific details of that error are written here, not to the screen.
The templates_c Directory
CiviCRM uses the Smarty templating engine to generate its user interface. To improve performance, Smarty "compiles" these templates into PHP files and stores them in templates_c. Occasionally, these compiled files can become corrupted or outdated—especially after a CiviCRM version upgrade or an extension installation. Deleting the contents of this folder forces CiviCRM to regenerate the files, often resolving display issues.
CiviCRM Log and Cache Locations by CMS
The location of these folders depends entirely on which CMS you are using and how your file system is structured. In most modern installations, these two directories are found side-by-side within a parent civicrm folder.
WordPress
For modern WordPress installations, CiviCRM stores its data in the standard uploads directory.
- Path:
<wordpressroot>/wp-content/uploads/civicrm/
Note on Older Installations: If your CiviCRM site was installed many years ago and has been upgraded through the versions, you might still be using the legacy path: <wordpressroot>/wp-content/plugins/files/civicrm/. However, any site running CiviCRM version 5.29 or later will prioritize the uploads location.
Drupal (7, 8, 9, and 10)
Drupal follows a very standardized structure for its public and private files.
- Path:
<drupalroot>/sites/default/files/civicrm/
If you are running a multi-site Drupal installation, replace default with your specific site's directory name (e.g., sites/myorg.org/files/civicrm/).
Joomla
Joomla keeps CiviCRM data within its media folder to ensure it is accessible but separated from the core system files.
- Path:
<joomlaroot>/media/civicrm/
Backdrop CMS
Backdrop, being a fork of Drupal, maintains a similar structure but simplifies the root file path.
- Path:
<backdroproot>/files/civicrm/
CiviCRM Standalone
In the Standalone version of CiviCRM, the structure is slightly different to improve security and clarity. The folders are also named more intuitively.
- Path:
<webroot>/private/ - Folder Names: In Standalone,
ConfigAndLogis renamed tolog, andtemplates_cis renamed tocache.
How to Access These Files
To view logs or delete cache files, you generally need access to your server's file system. There are three common ways to do this:
- SFTP/SSH: This is the most secure method. Use a client like FileZilla or Cyberduck to navigate to the paths listed above. You can download the log files to your local machine for easier reading in a text editor like VS Code or Notepad++.
- Hosting Control Panel: If you use cPanel, Plesk, or a custom host dashboard, look for a "File Manager" tool. This allows you to browse folders and delete the contents of
templates_cdirectly in your browser. - Command Line: For developers, using
tail -fon the log file via SSH is the fastest way to watch errors happen in real-time as you replicate a bug.
A Shortcut: The CiviCRM Log Viewer Extension
Sometimes, you may not have FTP access, or you might find it tedious to log into a server just to check a quick error. Fortunately, the CiviCRM community has developed a more convenient solution.
By installing the CiviCRM Log Viewer extension, you can view the contents of your ConfigAndLog files directly from the CiviCRM administrative interface. Once installed, a new link appears under the Administer menu, allowing you to search through logs and identify issues without ever leaving your browser. This is a "must-have" for administrators who manage sites for non-technical clients.
Frequently Asked Questions
Is it safe to delete everything in the templates_c folder?
Yes. It is perfectly safe to delete the contents of templates_c. CiviCRM will automatically recreate the necessary files the next time a page is loaded. However, do not delete the templates_c folder itself—only the files and subfolders inside it. If you do delete the folder, ensure you recreate it with the correct write permissions.
Why can't I see any files in my ConfigAndLog directory?
This is usually a file permission issue. If the web server (e.g., Apache or Nginx) does not have "write" permissions for that directory, CiviCRM cannot create the log files. Ensure that the directory permissions are set correctly (typically 755 or 775, depending on your server environment).
How often should I clear my CiviCRM logs?
CiviCRM logs can grow quite large over time, especially on high-traffic sites. It is a good practice to archive or delete old log files periodically. Some advanced users set up a "log rotation" script to handle this automatically, but for most, checking and clearing them every few months is sufficient.
Wrapping Up
Knowing where your ConfigAndLog and templates_c directories are located is a fundamental skill for managing a CiviCRM site. Whether you are on WordPress, Drupal, or Joomla, these directories hold the keys to resolving the most common platform issues.
Key Takeaways:
- ConfigAndLog is for finding errors; templates_c is for clearing display cache.
- Most CMS platforms store these in a subfolder of their standard "files" or "uploads" directory.
- If you prefer a GUI, use the CiviCRM Log Viewer extension to see errors inside CiviCRM.
- Always check file permissions if logs aren't appearing or if the cache won't clear.
By mastering these file paths, you move from being a user to a power administrator capable of keeping your CRM running smoothly.