PHP Temporary Directory is not set.

Error Message

The PHP temporary directory is not set

The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla! can access this file. Whilst the directory not being set isn't always a problem, if you are having issues with manifest files not being detected or uploaded files not being detected, setting this in your php.ini file might fix the issue.

Even though you get this error, it may not be a problem. You only need to deal with it if you have problems uploading themes and extensions.

You get this error because Joomla extracts all the files and places them in a temporary directory, then copies them to their own directories. If the PHP Temp directory is missing, has the wrong permissions, or has the wrong path set, Joomla can't save the files to the temporary directory, so it produces a message.

  1. In Joomla 1.7 and above, if you go to the Extension Manager and the Warnings tab you might see this warning directly after installation.
  2. You may also see it when you try to upload a template, module or plugin.
  3. If you have a WAMP installation on your local computer, you may get this error..
  4. If you uploaded from a local computer via ftp and the path was set locally and needs to be changed.

Step 1. Check your settings

You can see how all your php.ini settings are configured in Joomla 1.7 by going to

  • Go to Site>System Information>PHP Settings Tab
  • Switch to the Configuration File Tab. You will see what your tmp_path is set to in the list on that screen.
  • Switch to Directory Permissions Tab and see if your tmp directory has the correct permissions.

The simplest solution is to go to your Joomla Global Configuration > Server tab and enter the correct path to your tmp directory. Here is what that typically looks like /home/isername/public_html/tmp

Another reason is may be that your php.ini file does not have have the correct quota settings or file uploads are turned off. You can see the file uploads setting in the PHP Settings Tab.You can check these lines in your php.ini file to see if they are correct.

Before you start:

  • Check to see that you have a tmp directory in your Joomla root directory. If not, create one.
  • Check to see if its permissions are 755 or 705 and change if necessary
  • Backup you php.ini file (it is critical to operation of the site and you don't want to break anything.)

Checking the php.ini file for tmp directory settings. Open the php.ini file in an editor and go to the File Uploads section.

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

EXAMPLE OF CHANGES: if needed

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads. Make sure this is on.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir ="/home/username/public_html/tmp" Be sure to use quotes.

This is typically blank in php.ini. If it is Joomla should be getting the default path from your config.php file. But sometimes you need to specify the path. If it's not blank and you have the path set in config.php, try making it blank first. Some Example of what the path could look like:

  • c:/wamp/tmp (on your local computer)
  • /var/www/tmp
  • /public_html/tmp
  • /public_html/somesubdirectory/tmp
  • /tmp

; Maximum allowed size for uploaded files.
upload_max_filesize = 64M (This may need to be larger. I have changed this from 2M to 64M which is plenty of memor. Usually 8M is fine)

NOTES-

1. You may not access to the php.ini. On Godaddy servers and some others there is no php.ini file that you can access.

There may be one, but it was created by a plugin or addition to handle extra information that isn't in the basic php.ini file. In this case you probably don't need to change the path. The php.ini file should use whatever is the default tmp file. You may have to have check with your server administrator to get the correct path, and to check if you have a default tmp file and that it's permissions are correct.

2. Your web host's cPanel may have an icon for easily modifying your php.ini. You'l be able to turn file_uploads on from there and change the upload_max_filesize, without having to open and edit php.ini.