A fatal error has occurred Cannot write to cache directory /tmp

While accessing WebMail client I was getting an error as below -

A fatal error has occured
Cannot write to cache directory /home/username/tmp
Deatails have been logged for the administrator

Solution -

1. Make sure to check the disk usage of your account, it should not be full.
2. Check the inode usage of your account, it should not be exceeded. You can fire below command to check the detailed inode usage of your account -

echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"

I was facing the issue because the inode usage for my account was exceeded. You can check it from cPanel >> Inode usage.

You can follow below steps to reduce the inode usage -
==========================================================
1. Remove all files/folders you don’t need.
2. Check the number of cache files you have, applications such as Joomla can generate a lot of cache files; you should regularly check your cache folder and reduce the number of cached files you keep.
3. Make sure you check the mailbox regularly and delete all mails you don't need.
4. Check your cPanel's main email account regularly, the mails for it are kept in:
/home/username/mail/cur
/home/username/mail/new
where username is your cPanel username. You can manually delete the messages in these folders using cPanel's File Manager.
5. You should also check your email accounts regularly and delete any spam messages from them.
6. If you have email accounts you don't need or use, it would be best to remove them.
==========================================================

In my case, it was due to .trash directory. I've removed the directory. It resolved my issue!

Was this answer helpful?

 Print this Article

Also Read

How to force the site to use https using .htaccess file?

If you've working SSL certificate on your website and you'd like force your website to load using...

How to check the PHP version and configuration for your website?

'phpinfo.php' is the file which is used for checking the PHP version and configuration on cPanel...

Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server.

I was getting below error message in cPanel while creating addon domain from cPanel >>...

How to Install cPanel on CentOS 6 or 7?

How to install cPanel on CentOS 6 or 7.  Please note cPanel does not support any other operating...

Fatal error: Class 'JCache' not found in /libraries/joomla/factory.php - Joomla Issue

After updating the Joomla, I was getting Fatal error: Class 'JCache' not found in...

Powered by WHMCompleteSolution