How to fix temporary file is missing in wordpress?

To fix wordpress issue when error temporary file is missing is thrown follow this tutorial:

Method 1

  • Locate wp-config.php file in the root of your wordpress site.
  • Add the following code after /* That’s all, stop editing! Happy blogging. */:
define('WP_TEMP_DIR', sys_get_temp_dir());

Method 2

Create a tmp folder in your WordPress root directory with 777 permissions.
This can be done by your FTP program.

So create a folder called tmp then chmod to 777.

Also create a php.ini file in the same location.

Open notepad and paste the below into a file and save as “all files” then type php.ini as filename.

Add the following in php.ini file:

upload_max_filesize = 16M
upload_tmp_dir = on
upload_tmp_dir = /home/username/public_html/wordpressDir/tmp

^^^^
Please make sure to replace username with your hosting username, and wordpressDir with the directory name of your WordPress install. If you have installed WordPress on your homepage then the path will be like:upload_tmp_dir = /home/username/public_html/tmp

Copy the same php.ini file to your wp_admin folder so you have one there too.