WordPress Error: Missing a Temporary Folder

WordPress | Updated March 2026

The "Missing a temporary folder" error in WordPress occurs when PHP can't find or write to the temporary directory it uses for file uploads. This prevents you from uploading media, installing plugins, or updating themes. The fix is to define the temp directory explicitly in your WordPress configuration.

01. Why This Happens

When WordPress uploads a file, PHP first writes it to a temporary directory before moving it to the final location. PHP determines this directory from the upload_tmp_dir setting in php.ini. If that setting is empty, PHP falls back to the system temp directory (usually /tmp).

On shared hosting servers, the system /tmp directory is often mounted with restrictions (noexec, quota limits) or is isolated per-account via CloudLinux's CageFS. If PHP can't write to the temp directory for any reason, WordPress shows this error.

02. The wp-config.php Fix

The most reliable fix is to tell WordPress to use its own temp directory inside wp-content/. Edit wp-config.php and add:

define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/tmp/');

Then create the directory:

mkdir ~/public_html/wp-content/tmp
chmod 755 ~/public_html/wp-content/tmp

Or create it through cPanel's File Manager: navigate to wp-content/, click "+ Folder," name it tmp.

Tip

This temp directory will accumulate partial upload files over time. Add a cron job to clean it periodically: find ~/public_html/wp-content/tmp/ -type f -mtime +1 -delete

03. Checking PHP's Temp Directory

To see what PHP currently uses as the temp directory, create a temporary phpinfo.php file:

<?php phpinfo(); ?>

Search for upload_tmp_dir in the output. If the "Local Value" is empty or shows a directory that doesn't exist, that confirms the cause. Delete the phpinfo file when done.

You can also set the PHP temp directory through cPanel's "Select PHP Version" > PHP Options > upload_tmp_dir. Set it to /home/username/tmp (create the directory first).

04. Verifying Permissions

Make sure the temp directory and its parents have correct permissions:

ls -la ~/public_html/wp-content/tmp/
# Should show: drwxr-xr-x  username username

The directory needs 755 and should be owned by your cPanel username. If the ownership is wrong (e.g., owned by root or nobody), fix it:

chown username:username ~/public_html/wp-content/tmp/

For related upload permission errors, see our guides on unable to create uploads directory and uploaded file could not be moved.

Still Getting the Error?

If defining WP_TEMP_DIR doesn't resolve it, there may be an open_basedir restriction preventing PHP from writing to the directory. Open a support ticket and we'll check the PHP configuration.

Open a Support Ticket

Quick Recap: Missing Temporary Folder

  1. Add WP_TEMP_DIR - Define the temp path in wp-config.php
  2. Create the directory - Make wp-content/tmp/ with 755 permissions
  3. Check ownership - Directory must be owned by your cPanel user
  4. Clean periodically - Set a cron to delete old temp files
  5. Check php.ini - Verify upload_tmp_dir points to a valid, writable path

Last updated March 2026 · Browse all WordPress articles

  • 2 Users Found This Useful

Was this answer helpful?

Related Articles

Create Static Files with your WordPress Install

WordPress | Updated 2026 WordPress generates pages dynamically on every request, which uses...

WordPress Site Search

WordPress | Updated 2026 WordPress includes a built-in site search that lets visitors find...

How to Install WordPress

WordPress | Updated March 2026 Installing WordPress on your Ultra Web Hosting account takes...

Not Receiving Form Email Through WordPress - SMTP

WordPress | Updated March 2026 If your WordPress contact forms aren't sending email, the...



Save 30% on web hosting - Use coupon code Hosting30