Thursday 27 September 2012

PHP.ini

So you have installed Joomla 2.5, 3.+ or 3.5+ and under "Extension Manager: Warnings" you get the following error:



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.

You can use one of the fixes below:

If you have access to your httpd.conf file

Add your temp directory to it, it will look something like this:

php_value upload_tmp_dir = /my/path/to/my/websites/home/dir/tmp

This is the full home directory path to your joomla site, with the '/tmp' added
Note: Replace my sample path with yours

If you have access to your php.ini file the add the following line:

Add your temp directory to it, it will look something like this:


upload_tmp_dir = /home/accountname/public_html/tmp

Note: Replace my sample path with yours



You are on a shared hosting environment and you don't have access to the http.conf file, or don't have a php.ini file, then do the following:




1. Create a php.ini file in the /administrator/ directory of your Joomla web site
2. Add your temp directory to it, it will look something like this:

upload_tmp_dir = /home/accountname/public_html/tmp

Replace my sample path with yours

3. Add a line to your .htaccess file telling your site to use the php.ini file. Add this line:

SetEnv PHPRC /home/accountname/public_html/administrator/

Note: Replace my sample path with yours


Now login to your admin panel, and the warning should be gone!