Temporary File Management
Understand Pantheon's default temporary path and learn how to debug .tmp file errors.
This section provides information on how to use and debug the default temporary path, .tmp.
This doc uses Terminus commands. Before you begin, set the variables $site and $env in your terminal session to match your site name and the correct environment:
Default Temporary Path
WordPress
You can get the Pantheon-configured temporary path for WordPress on the Pantheon Systems WordPress Github.
Drupal
We don't recommend changing the temporary settings path for Drupal. Changing the configuration allows temporary files to be shared across application containers, but heavily impacts performance.
Add the code below to your settings.php file to get the appropriate configuration for Drupal sites.
Fix Unsupported Temporary Path
Errors caused by an unsupported temporary path typically surface as permission errors for .tmp files and can be replicated on any environment.
Multiple Application Containers
Errors caused by this scenario occur on production environments (Test or Live) and typically reference some .tmp file as not found and could not be copied. These errors cannot be replicated on development environments (Dev or Multidev) because those environments use a single application container.
Sites on the Performance Medium plan and above have multiple application containers. The platform routes requests across available application containers based on their load to help sites perform at scale.
The default temporary path ($_SERVER['HOME'] . '/tmp') is not synchronized across application containers which causes operations that expect this path to persist will fail.
Considerations
It's uncommon for a plugin, module, or theme to use the temporary path in a way that results in such errors. We suggest reporting the issue to the author and replacing the conflicting plugin, module, or theme whenever possible until a fix is released.
Be aware that temporary files are not cleaned up automatically in the following configuration, which can result in highly populated directories.
Persistent Temporary Path Workaround
There's generally no need for temporary files to persist across application containers. You can use a different plugin or module to avoid a performance hit that accompanies the workaround below. The following workaround is potentially dangerous and may result in downtime if the offending plugin is very active writing to the temporary files.