CPanel / WHM, WordPress

WordPress file upload giving: Missing a temporary folder error

How to Fix “Missing a Temporary Folder” Error in WordPress

WordPress Missing a Temporary Folder error prevents you from updating themes and plugins, uploading files and images, and even bringing up to date the WordPress core. Here, we will help you solve this issue easily. By the end of this article, your WordPress will be up and running again in no time!

What is “Missing a Temporary Folder” Error in WordPress?

The “Missing a Temporary Folder” error is the result of incorrect PHP settings on your WordPress hosting environment. One of those settings dictates WordPress to store uploaded files in a temporary folder before saving them to the desired location. Without access to that temporary folder, WordPress won’t be able to process your uploaded files and software updates.

Whether or not you deleted the temporary folder by accident, this error occurs when WordPress cannot locate or access that folder.

Now that we’ve covered the culprit behind the “Missing a Temporary Folder” error, let’s see how to fix it in no time.

Fixing “Missing Temporary Folder” Error in WordPress

You can easily fix this WordPress error by modifying your site’s wp-config.php file.

IMPORTANT! Be sure to backup the wp-config.php file before making any changes to prevent data loss.

  1. Establish a connection with your account using an FTP client or File Manager in your hosting control panel. We’ll be using the hPanel for this tutorial.
  2. Access the wp-config.php file from the WordPress root installation folder. In most cases, you can find the file in the public_html directory.
    Searching for the wp-config.php file using Hostinger's File Manager
  3. Add the following code snippet before the line “That’s all, stop editing! Happy publishing”.define(‘WP_TEMP_DIR’,dirname(_FILE_). ‘/wp-content/temp/’);
  4. Save the changes, then re-upload the updated wp-config.php file to your website.
  5. Moving back to the File Manager, locate the /wp-content folder and add a new folder under the name of temp inside it.
    Searching for the temp folder using Hostinger's File Manager
  6. That’s it! After re-logging into your WordPress site, you should be able to upload images again.

IF still issue is not resolved and server is having Cloudlinux installed then follow below step.

Login to the server via SSH.

Try disabling cagefs for that particular user and enable it again using below commands.

cagefsctl --disable $USER
cagefsctl --enable $USER

You can do that from the WHM as well.

Login to the WHM.
Click on Server Configuration » CloudLinux LVE Manager
Click on users tab.Search that user and click on Cagefs enable disable button.