In Joomla, while accessing the ‘Extension Manager’ feature in Admin panel, a commonly noticed warning is ‘PHP temporary directory is not set’.
Extension Manager is used to manage the Joomla extensions via the Admin panel and any warnings in the page can cause a hindrance in updating and installing them.
Extensions such as plugins, modules, templates, etc. helps to add on to the functionality of Joomla. Today we’ll see what causes this joomla error and how to fix it.
What is PHP temporary directory
The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla can access this file.
In a webserver, the PHP temporary directory parameter is configured in the php.ini file. There would be a server-wide php.ini file to configure PHP settings.
Many servers allow users to have custom php settings in their accounts for their software. They will have PHP settings defined in local php.ini or ‘.htaccess’ files.
The PHP temporary directory, can thus be a server directory such as ‘/tmp’, or any tmp folder configured in the user’s document root.
PHP parameter ‘upload_tmp_dir’ is used to set the PHP temporary directory in the php.ini settings.
What causes ‘PHP temporary directory is not set’ error
The warning shown in Joomla page happens because the Joomla software is unable to access or write into the PHP server’s temporary directory.
The Joomla error ‘PHP temporary directory is not set’ happens due to these reasons:
1. PHP temporary directory defined in php.ini is missing
2. PHP temporary directory is not set in the php.ini file
3. The permissions of the PHP temporary directory are incorrect
How to fix ‘PHP temporary directory is not set’
Here is the step-by-step approach to fix this warning:
- Using the ‘phpinfo’ page for the website, identify the php.ini file that is used for configuring PHP.
- Check for the ‘/tmp’ folder in the server. If there isn’t one, create it.
- Make sure that the ‘/tmp’ folder has adequate read and write permissions (777 with a sticky bit).
- Verify the parameter ‘upload_tmp_dir‘ and confirm that it shows the ‘/tmp’ directory.
- For users with custom php ini and temporary directory, make the corresponding updates.
- The path to this temporary directory (/tmp) should be updated in Joomla ‘Global Configuration’ using the option “Site > Global Configuration > Server“.
Now reload the ‘Extension Manager’ page in Joomla Administration page and the warnings would be gone!
To summarize..
Today we saw how to fix the Joomla error ‘PHP temporary directory is not set’ by configuring the PHP temporary directory settings.
In some cases, the parameter ‘session.save_path’ also need to be checked. It is the path where session files are created. It is defined in the php.ini file and default value is ‘/tmp’.
If you’d like to know how to manage your Joomla websites with zero downtime and no errors, we’d be happy to talk to you.
0 Comments