Apache Error: Failed to create temporary file

On checking Apache error logs it shows the error:

[error] ModSecurity: Input filter: Failed to create temporary file: 
[hostname "www.cpanelplesk.com"] [uri "/wp-admin/admin.php"] 
[unique_id "VjGXSkAWQiQAA@W7VAsAAAAD"]

The error occurs when the modsecurity has no access on /root/tmp directory.

So while accessing /root/tmp it will show the error “Failed to create temporary file”
This error can be fixed by adding the following lines on the configuration file of modsecurity.

nano /usr/local/apache/conf/modsec2.conf

Add these below lines in /usr/local/apache/conf/modsec2.conf

SecUploadDir /tmp
SecTmpDir /tmp
SecDataDir /tmp
SecRequestBodyAccess On

Now restart Apache service to make the changes effective

service httpd restart

That’s all to do to fix the issue. You also like to know Prevent .Htaccess File Modification While Running EasyApache , Please check that and also Give your opinion below if you experience any issues or to discuss your ideas and experiences.