Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

The “Missing a temporary folder” message usually means PHP cannot create or access the temporary directory it needs to process an upload. The underlying PHP error is UPLOAD_ERR_NO_TMP_DIR, so the durable fix is normally at the PHP or hosting level—not installing another WordPress plugin.

Check the server’s upload_tmp_dir, its open_basedir restriction, and the PHP worker’s permissions first. If you cannot change those settings, ask your host to correct them. A WP_TEMP_DIR override can help when WordPress’s normal fallback directories are unsuitable, provided the path is genuinely writable by PHP.

What the error means

When you upload an image, WordPress first relies on PHP to place the incoming file in a temporary directory. If PHP cannot supply that directory, it returns UPLOAD_ERR_NO_TMP_DIR, which WordPress displays as “Missing a temporary folder.” The same failure can affect theme, plugin, or core update downloads that need temporary storage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is different from an uploads-directory error. WordPress’s permanent media location is normally WP_CONTENT_DIR/uploads; that path has separate ownership and writability requirements.

Fix the PHP temporary directory first

Inspect upload_tmp_dir

In the active PHP configuration, find upload_tmp_dir. It must point to a directory that exists and can be written by the PHP-FPM or Apache worker serving the site. Check the PHP configuration used by the web server, not only the PHP version shown in a command-line shell, because those can use different configuration files.

  • Confirm the configured path exists.
  • Confirm the PHP execution user can create and remove files there.
  • Check available disk space and any hosting quota.
  • Check that open_basedir permits access to the directory.

If you do not control PHP configuration, open a hosting ticket and quote the exact “Missing a temporary folder” message. Ask the provider to verify upload_tmp_dir, open_basedir, directory ownership, PHP-worker access, and free space.

Why open_basedir matters

A directory can look writable in FTP or a hosting file manager while PHP is prohibited from reaching it. An open_basedir rule that excludes the configured temporary path produces the same practical symptom. The host must adjust the allowed path or choose a permitted temporary directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand WordPress’s temporary-directory fallback

When WordPress needs a temporary location, get_temp_dir() checks candidates in this order:

  1. The directory returned by sys_get_temp_dir().
  2. The PHP upload_tmp_dir value.
  3. WP_CONTENT_DIR.
  4. /tmp/.

WordPress uses the first candidate that is writable. If none works, you can override the result with WP_TEMP_DIR in wp-config.php. The override does not bypass PHP restrictions: the directory must exist, be accessible to the PHP worker, and be allowed by open_basedir.

Set a private WP_TEMP_DIR fallback

Use this option when you have filesystem access and the server’s PHP policy allows a site-specific temporary directory.

  1. Create a directory outside the public web root when your host permits it. If you use a directory under WordPress, a common example is WP_CONTENT_DIR . '/temp'.
  2. Set its owner or group so the site’s PHP-FPM/Apache user can read, write, create, and delete files.
  3. Add this single line to wp-config.php above the comment That’s all, stop editing! (the exact comment may use straight apostrophes):
    define( 'WP_TEMP_DIR', WP_CONTENT_DIR . '/temp' );
  4. Retry the Media Library upload and, if relevant, a plugin or theme update.

Do not apply a universal 755 recipe without checking the host’s ownership model. Permissions alone cannot compensate for the wrong owner, a restrictive security policy, a full quota, or an open_basedir exclusion. If creating the folder and adding the constant changes nothing, remove the guesswork and have the host inspect the PHP worker and filesystem policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the separate WordPress uploads directory

If PHP can create a temporary file but WordPress cannot move it into the Media Library, inspect the permanent uploads path. wp_upload_dir() normally uses WP_CONTENT_DIR/uploads and reports an error when the parent directory cannot be created or is not writable.

  • Verify that wp-content/uploads exists, or that PHP can create it.
  • Check every parent directory from the filesystem root through wp-content; one non-traversable parent is enough to fail.
  • Check ownership after a migration, restore, or change of PHP-FPM pool.
  • Confirm that disk quotas and inode limits have not been reached.

This repair addresses the destination for permanent media. It does not replace a missing or inaccessible PHP temporary directory.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use WordPress diagnostics briefly

Enable logging only while reproducing the failure, and keep logs inaccessible to visitors. In wp-config.php, above the stop-editing line, you can use:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Retry one upload, then inspect wp-content/debug.log through a protected administrative or hosting channel. Look for filesystem, permission, or PHP upload messages that identify whether the failure occurs during temporary upload handling or while creating the final uploads directory. Turn the diagnostic constants off after troubleshooting and protect or remove any log that could expose site information.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right fix

Option Use it when What it can and cannot solve
Server PHP fix Multiple sites or all PHP uploads fail, or upload_tmp_dir/open_basedir is wrong Corrects the underlying temporary path, access rules, ownership, or system temporary directory; requires server access or host support
WP_TEMP_DIR fallback You administer one site and can create a PHP-writable directory Gives WordPress a known temporary path; cannot override PHP restrictions, security policies, or an inaccessible filesystem
Uploads-permission repair The temporary file works but wp-content/uploads cannot be created or written Fixes the permanent media destination; it does not repair PHP’s temporary upload configuration
Hosting escalation You lack PHP configuration access or self-service changes fail Lets the provider inspect PHP-FPM/Apache identity, quotas, open_basedir, SELinux/AppArmor rules, and the configured temporary path

When to stop changing files and contact the host

Escalate when the configured directory exists but PHP still cannot write to it, when the site runs in a container or restricted PHP-FPM pool, or when SELinux/AppArmor and similar policies may deny access. Shared-hosting file managers often test as your account rather than as the PHP worker, so an apparently writable folder is not proof that WordPress can use it.

Include the site domain, the exact error text, the PHP version and handler if known, when the problem began, and whether all uploads or only this site are affected. Request verification of upload_tmp_dir, open_basedir, worker ownership, directory permissions, quota, and free space.

Verify the repair

  1. Log in to WordPress and upload a small image through Media > Add New.
  2. Open the attachment from the Media Library and confirm it generates the expected image sizes.
  3. If updates were failing, test the affected plugin, theme, or core update after taking the usual backup precautions.
  4. Check that no new PHP or WordPress filesystem error appears in the log.
  5. Disable temporary debugging and remove any temporary test files or directories that are no longer needed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.