Title: xml import impossible &#8220;missing temporary folder&#8221; bug
Last modified: April 12, 2020

---

# xml import impossible “missing temporary folder” bug

 *  [nicob73](https://wordpress.org/support/users/nicob73/)
 * (@nicob73)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/)
 * Hi,
 * Me too I’m trying to fix this “missing temporary folder bug”.
    Version of PHP/
   MySQL : 7.3 Theme : twenty twenty Extensions : akismet, blogger importer, limit
   login attemps reloaded, wordpress importer Webhost : wedos Site : dreamsandmoods.
   be
 * I’ve been through the usual solutions but it does not work: in php I have the
   command line define(‘WP_TEMP_DIR’,dirname(__FILE__).’/wp-content/uploads’); and
   the folder is in place. I’ve tried to change it to temp, that does not change
   anything. The folder access type is 755 and the 644 for the files.
 * I checked if my xml file is corrupted with xmlvalidation and it looks good. I’ve
   even tried with an xml file created by blogger… Nothing works.
 * So if anybody could help me that would be great. (To be fair I don’t understand
   that bug exists since so many years.)
 * Thanks a lot,
 * Nico
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fxml-import-impossible-missing-temporary-folder-bug%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12661807)
 * Try reviewing [https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/#missingtempfolder](https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/#missingtempfolder)
 *  Thread Starter [nicob73](https://wordpress.org/support/users/nicob73/)
 * (@nicob73)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12661832)
 * Thanks a lot for the link but yes, I did that. As I said in the original post(‘
   WP_TEMP_DIR’,dirname(__FILE__).’/wp-content/uploads’); and the folder was created.
   I really don’t understand: (
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12662380)
 * Why `dirname(__FILE__)`? This seems weird.
 * Where exactly do you have this PHP code inserted at?
 *  Thread Starter [nicob73](https://wordpress.org/support/users/nicob73/)
 * (@nicob73)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12662455)
 * Hi, please find my wp-config.php here under (except PWD and authentification 
   keys). The line is under “other customizations” It’s the command I’ve found in
   all the forums except that it not a “uploads” file needed but “temp”. But it 
   does not change anything.
 * Nico
 *     ```
       <?php
       /**
        * The base configuration for WordPress
        *
        * The wp-config.php creation script uses this file during the
        * installation. You don't have to use the web site, you can
        * copy this file to "wp-config.php" and fill in the values.
        *
        * This file contains the following configurations:
        *
        * * MySQL settings
        * * Secret keys
        * * Database table prefix
        * * ABSPATH
        *
        * @link https://codex.wordpress.org/Editing_wp-config.php
        *
        * @package WordPress
        */
   
       // ** MySQL settings - You can get this info from your web host ** //
       /** The name of the database for WordPress */
       define( 'DB_NAME', '' );
   
       /** MySQL database username */
       define( 'DB_USER', '' );
   
       /** MySQL database password */
       define( 'DB_PASSWORD', '' );
   
       /** MySQL hostname */
       define( 'DB_HOST', '(removed)' );
   
       /** Database Charset to use in creating database tables. */
       define( 'DB_CHARSET', 'utf8' );
   
       /** The Database Collate type. Don't change this if in doubt. */
       define( 'DB_COLLATE', '' );
   
       /**#@+
        * Authentication Unique Keys and Salts.
        *
        * Change these to different unique phrases!
        * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
        * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
        *
        * @since 2.6.0
        */
       define('AUTH_KEY') THEY EXIST BUT I DONT PUT THEM HERE
   
       /**
        * Other customizations.
        */
       define('FS_METHOD','direct');
       define('FS_CHMOD_DIR',0755);
       define('FS_CHMOD_FILE',0644);
       define('WP_TEMP_DIR',dirname(__FILE__).'/wp-content/uploads');
   
       /**
        * Turn off automatic updates since these are managed externally by Installatron.
        * If you remove this define() to re-enable WordPress's automatic background updating
        * then it's advised to disable auto-updating in Installatron.
        */
       define('AUTOMATIC_UPDATER_DISABLED', true);
   
       /**#@-*/
   
       /**
        * WordPress Database Table prefix.
        *
        * You can have multiple installations in one database if you give each
        * a unique prefix. Only numbers, letters, and underscores please!
        */
       $table_prefix = 'pl3z_';
   
       /**
        * For developers: WordPress debugging mode.
        *
        * Change this to true to enable the display of notices during development.
        * It is strongly recommended that plugin and theme developers use WP_DEBUG
        * in their development environments.
        *
        * For information on other constants that can be used for debugging,
        * visit the Codex.
        *
        * @link https://codex.wordpress.org/Debugging_in_WordPress
        */
       define( 'WP_DEBUG', false );
   
       /* That's all, stop editing! Happy publishing. */
   
       /** Absolute path to the WordPress directory. */
       if ( ! defined( 'ABSPATH' ) ) {
       	define( 'ABSPATH', dirname( __FILE__ ) . '/' );
       }
   
       /** Sets up WordPress vars and included files. */
       require_once( ABSPATH . 'wp-settings.php' );
       ```
   
 * _**[Moderated: Code formatted. See [https://wordpress.org/support/forum-user-guide/faq/#i-need-to-post-code-is-that-okay%5D](https://wordpress.org/support/forum-user-guide/faq/#i-need-to-post-code-is-that-okay%5D)**_
    -  This reply was modified 6 years, 1 month ago by [t-p](https://wordpress.org/support/users/t-p/).
      Reason: code formated
    -  This reply was modified 6 years, 1 month ago by [t-p](https://wordpress.org/support/users/t-p/).
    -  This reply was modified 6 years, 1 month ago by [t-p](https://wordpress.org/support/users/t-p/).
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12663513)
 * Right. So, if the wp-config.php is in the same directory as the /wp-content directory,
   then that line would be okay.
 * However, I would not suggest using the uploads folder for this. I would suggest
   making a /temp folder in there with an unusual name, such as /temp-1234 or something
   randomish. You then would use that folder like so:
 * `define('WP_TEMP_DIR',dirname(__FILE__).'/temp-1234');`
 * You then need to give that folder 777 permissions, to let anything write to it.
 * Alternatively, you should figure out what’s wrong with your system in the first
   place, and why you cannot use the normal system /tmp folder. Defining a temporary
   folder for WordPress is possible, sure, but that is more of a workaround for 
   situations where the system default temporary folder is misconfigured and you
   have no access to be able to fix it.
 * If you leave WP_TEMP_DIR undefined, then WordPress will use the system temp directory(
   as returned by `sys_get_temp_dir()`), or if that is not available it will use
   the directory defined by the PHP’s `upload_tmp_dir` setting. If both of these
   do not work, then your system is badly misconfigured in some manner, and should
   be examined in more detail by a server administrator.
 * In other words, you should never need to use the WP_TEMP_DIR define in the first
   place except in particularly unusual and extreme circumstances, or for debugging
   the WordPress core update processes.
 * Basically: Complain to your host to fix their servers, or switch to a better 
   host.
 *  Thread Starter [nicob73](https://wordpress.org/support/users/nicob73/)
 * (@nicob73)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12699799)
 * Hi Samuel, finally I followed your advice: I switched to another host and everything
   worked fine with the “normal” way of creating a temp file.
    Thanks a lot for 
   your time. Nico

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

The topic ‘xml import impossible “missing temporary folder” bug’ is closed to new
replies.

## Tags

 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [xml](https://wordpress.org/support/topic-tag/xml/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [nicob73](https://wordpress.org/support/users/nicob73/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/xml-import-impossible-missing-temporary-folder-bug/#post-12699799)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
