Title: Missing a temporary folder error
Last modified: April 12, 2021

---

# Missing a temporary folder error

 *  [made2105](https://wordpress.org/support/users/made2105/)
 * (@made2105)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/)
 * I worked in my blog last week, and today I wanted to upload an image and I get
   the “missing temporary folder” error.
 * I’ve already added the following line to the wp-config.php file:
    define(‘WP_TEMP_DIR’,
   dirname(__FILE__) . ‘/wp-content/temp/’);
 * I’ve also added a “temp” folder to the /wp-content/ folder and changed permissions
   as recommended in [https://www.wpbeginner.com/beginners-guide/how-to-fix-file-and-folder-permissions-error-in-wordpress/](https://www.wpbeginner.com/beginners-guide/how-to-fix-file-and-folder-permissions-error-in-wordpress/)
 * But I’m still getting the “missing a temporary folder” error!!!
 * My blog is [https://centroespigas.edu.uy/blog](https://centroespigas.edu.uy/blog)
 * I use the following plugins:
    – Polylang – Google Analytics para WordPress por
   MonsterInsights – UpdraftPlus
 * I would really appreciate if any of you can help me!
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmissing-a-temporary-folder-error-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12513389)
 * Try reviewing [https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/](https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/)
 *  Thread Starter [made2105](https://wordpress.org/support/users/made2105/)
 * (@made2105)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12513457)
 * Thanks t-p. But I already did everything explained in that tutorial.
    but I keep
   getting the message and cannot upload any images.
 *  Thread Starter [made2105](https://wordpress.org/support/users/made2105/)
 * (@made2105)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12517087)
 * Does anyone have other solution from what I already did and posted in the OP?
 *  Thread Starter [made2105](https://wordpress.org/support/users/made2105/)
 * (@made2105)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12524020)
 * Finally I figured out what was happening. I’m leaving this comment in case it
   helps someone else.
    Apart from following the instructions here [https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/](https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/)
 * you have to define the “temp” file in your php.ini file, usually located in your
   host provider settings.
 * ; Temporary directory for HTTP uploaded files (will use system default if not
   ;
   specified). ; [http://php.net/upload-tmp-dir](http://php.net/upload-tmp-dir) 
   upload_tmp_dir = /home/users/web/xxx/wp-content/temp
 *  [johannesk12](https://wordpress.org/support/users/johannesk12/)
 * (@johannesk12)
 * [6 years ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12814270)
 * Hi made2105,
 * I have the same issue and wanted to try out the “defining of the “temp” file 
   in your php.ini file”. I haven’t rewritten the php.ini file yet, could you please
   share your exact steps of how to rewrite it? That would be awesome!
 * Cheers,
    Johannes
 *  Thread Starter [made2105](https://wordpress.org/support/users/made2105/)
 * (@made2105)
 * [6 years ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-12815041)
 * Hi Johannes,
 * First you have to follow the instructions in [https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/](https://www.wpbeginner.com/wp-tutorials/how-to-fix-missing-a-temporary-folder-error-in-wordpress/)
 * After that, search for the php.ini file which is located in your hosting settings
   in your control panel. I suppose it would depend on which hosting server you’re
   using.
 * This is the part I was talking about and what I currently have written there:
 * ;;;;;;;;;;;;;;;;
    ; File Uploads ; ;;;;;;;;;;;;;;;;
 * ; Whether to allow HTTP file uploads.
    ; [http://php.net/file-uploads](http://php.net/file-uploads)
   file_uploads = On
 * ; Temporary directory for HTTP uploaded files (will use system default if not
   ;
   specified). ; [http://php.net/upload-tmp-dir](http://php.net/upload-tmp-dir) 
   upload_tmp_dir = /home/users/web/xxx/xxx/xxx/xxx/wp-content/temp
 * The xxx correspond to the folders were the blog or wordpress is located.
 * Hope this helps. If not, you might have to ask for assistance with your hosting
   provider.
 * Good luck!
 *  [Tobiáš Potoček](https://wordpress.org/support/users/tobice/)
 * (@tobice)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-13015508)
 * **Here is a more comprehensive take on how to fix `"Missing a temporary folder"`.**
 * Add `echo ini_get("upload_tmp_dir");` somewhere to your code. It will print the
   path to _that temporary folder_ that is supposedly missing. **Check that the 
   folder exists and is writable.**
    - If it doesn’t exist, then create it.
    - If it exists but is not writable, try to make it writable.
    - If you can’t create it / make it writable, try to change it to a folder that
      you can create & make writable using one of the approaches above (via `define("
      WP_TEMP_DIR", "...")`, `php.ini` or doing directly `ini_set("upload_tmp_dir","...")`).
    - If all of above fails (and it’s not unlikely that you won’t be allowed to 
      change PHP configuration in many environments), you need to reach out to your
      hosting provider.
 * **A bit more context:**
 * The way file upload works in PHP apps is that when the user uploads a file, it
   is stored to a _temporary directory_ by “the server” and the server then simply
   passes the path of this temporary file to the PHP app (= WordPress in this case).
   The app can then take the file and move it to the target location (e.g. wp-uploads).
 * If the _temporary directory_ for some reason doesn’t exist, the server indicates
   that to the PHP app as `UPLOAD_ERR_NO_TMP_DIR` which in this case WordPress converts
   into the infamous “Missing a temporary folder”.
 * What’s important is that **this mechanism is completely independent on WordPress!**.
   The _temporary directory_ is configured via `upload_tmp_dir` PHP ini config variable,
   i.e., it’s part of your server / PHP configuration. If it’s broken, it’s likely
   that you won’t be able to fix it yourself. You may try to override `upload_tmp_dir`
   but that’s very often not possible.
 * However, as this is part of the server configuration set up by your provider,
   it shouldn’t be broken all that often. What’s possible, though, is that somebody(
   most likely you) messed with the temporary folder, so even though the config 
   is correct, the folder is not (in my case, I accidentally deleted it). So the**
   first step for you is to check what the temp directory is and whether it exists
   and is writable.**
 * Now regarding `WP_TEMP_DIR`: This seems to have helped a lot of people, judging
   from the search results. TBH, given what I wrote above, I have no idea why `WP_TEMP_DIR`
   should be relevant for file uploads. It’s possible that WordPress does additional
   postprocessing (resizing images…) for which it needs its own temporary folder.
 *  [justicebriger](https://wordpress.org/support/users/justicebriger/)
 * (@justicebriger)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-13761184)
 * In my case it was the ‘Inodes’ (see the meaning [here](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjozfLqg7_tAhUotYsKHRYLAfkQFjABegQIBRAC&url=https%3A%2F%2Fwpsauce.com%2F6-tips-to-reduce-inode-usage-on-wordpress-websites%2F%23%3A~%3Atext%3DAn%2520inode%2520is%2520a%2520data%2Cis%2520stored%2520and%2520its%2520size.&usg=AOvVaw3EZ1HUnkRZfgs0LfnABqGN)).
   The Inodes you can find in your CPanel Statistics. Mine was over 100%, hence 
   the error.
 * To reduce your number of inodes you may want to see all these solutions proposed
   in this article: [https://www.socmedsean.com/solved-how-do-i-reduce-my-inode-usage-on-siteground-hostgator-or-other-hosts/](https://www.socmedsean.com/solved-how-do-i-reduce-my-inode-usage-on-siteground-hostgator-or-other-hosts/)
 * Summary:
    – Remove Unused Themes – Remove Old Plugins That Aren’t Needed Or Are
   Deactivated – Remove Overly-Complex Folder Structures – Remove Obsolete WordPress
   Core Files – Reduce The Number Of Images You Have Stored On Your Server – Delete
   Old Backup Files – Remove Unnecessary Cache Files – Work With Your Host To Remove
   Folders In The /tmp Or /temp Folders That You Might Not Have Access To
 *  [ryan_m27](https://wordpress.org/support/users/ryan_m27/)
 * (@ryan_m27)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-14098691)
 * Friends, I am having this issue after moving to php7.4. I have set the values
   in wp-config as well as my php.ini file. I can see that I have a upload_tmp_dir
   set correctly by printing phpinfo. I’ve played with permissions. Has anyone come
   across anything else that helped? Thanks!
 *  [ryan_m27](https://wordpress.org/support/users/ryan_m27/)
 * (@ryan_m27)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-14101319)
 * I think I got it. I ended up having to put a php.ini file specifying the temp
   dir in wp-admin in addition to the root wp directory.
 *  [Brian Coogan](https://wordpress.org/support/users/brianoz/)
 * (@brianoz)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-14306777)
 * I had this error happen and the problem was an old theme. I temporarily switched
   theme to one of the default WordPress themes (‘twentytwentyone’) and the error
   disappeared, at least in my case. I could see a whole bunch of JS errors in the
   browser console log (F12 in Chrome).
 * I did check out the temporary folder stuff above, but it didn’t seem to be key
   for me. Worth noting that my theme was VERY old and VERY broken (ie: PHP 5.6 
   days!), but just mentioning this in case someone else like me has tried everything
   else!
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-14308535)
 * Side note to [@brianoz](https://wordpress.org/support/users/brianoz/) ,
 * Thanks for helping out.
 * It’s been about a YEAR since the OP posted. If you are looking for topics that
   could benefit from your help, try looking in [https://wordpress.org/support/view/no-replies](https://wordpress.org/support/view/no-replies)

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Missing a temporary folder error’ is closed to new replies.

## Tags

 * [missing](https://wordpress.org/support/topic-tag/missing/)
 * [temp](https://wordpress.org/support/topic-tag/temp/)
 * [temporary folder](https://wordpress.org/support/topic-tag/temporary-folder/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 7 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/missing-a-temporary-folder-error-4/#post-14308535)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
