The Beginners’ Guide to Joomla Temp Directory

The Beginners’ Guide to Joomla Temp Directory

Every Joomla website includes a Temp (temporary) Directory. This folder is mostly used by the Joomla system when extensions are installed. When an extension is uploaded in the .zip format, it is stored in the tmp folder and then extracted into the correct folders. Besides, the temporary files of all other file manipulation tasks are also placed into the tmp folder.

In most cases, during the installation, all the related files are deleted or moved to a permanent location, so there are no remains which would require manual cleanup. However, depending on how the author writes the install instructions, the install process of the extension might not clean the temporary files automatically.

If you have installed a number of extensions, you may be holding a heavy tmp folder which:

  • Consumes much valuable hard disk storage.
  • May cause serious security issues. The files of out-dated extensions are vulnerable and might include insecure code. Things can be even worse if there is any executable file.

After introducing the basic information about the tmp directory, in below we would like to offer the solutions to some common issues.

Change the Path to the Temp Directory

Joomla includes a setting of “Path to Temp Folder”. If the path is not configured correctly or the permissions of the tmp folder are not right, you will not be able to install extensions. When there is any problem with the folder, you can get an error telling the archive does not exist.

To make sure the path is correct, firstly you need to log into your server, find the tmp folder, and copy the full path to the folder. Then, see the current configuration of the path by logging into your Joomla site, navigating to System > Global Configuration, opening the Server tab and locating the Server Settings.

Path to Temp Directory

Now you can check whether the path in the server settings matches what you get on your server. If there is anything wrong, copy the right path to the settings and then save it. The absolute path is preferred.

In terms of the permissions, make sure that the tmp folder is writable. The preferable permissions are 755.

Clean the Temp Directory

As is mentioned above, temporary files which are stuck in the tmp folder can take up storage as well as compromise the security of Joomla. Therefore, it is a good practice to check your temporary folder and perform cleanup periodically. You should keep the folder empty with nothing except index.html and .htaccess if any of them exists.

There are two ways you can use to clean the tmp directory up.

  • Use the File Manager in cPanel or an FTP client to delete the temporary files manually. This method is easy-to-handle, but you must do manual works every time and it could cost some time.
  • Install a plugin to perform scheduled cleanup, which is much more time-saving. A good option is the Admin Tools developed by Akeeba which includes a feature specially designed for cleaning up the tmp directory. But as the plugin includes tons of other features, you can find a more light-weight one to use if you do not need those features.