uploads - Missing a temporary folder not fixed

admin2025-01-07  3

I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum:

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

and created a 'temp' folder on 'wp-content', but the problem still happened .. how to fix that please ??

I tried by doing this : creating the folder on localhost with writable property then upload it to the server, but it still doesn't work

I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum:

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

and created a 'temp' folder on 'wp-content', but the problem still happened .. how to fix that please ??

I tried by doing this : creating the folder on localhost with writable property then upload it to the server, but it still doesn't work

Share Improve this question edited Jul 15, 2020 at 11:09 Hind Dev asked Jul 14, 2020 at 19:18 Hind DevHind Dev 1134 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0
  1. You need to add that line to your wp-config.php. Double check that you put it in the right place.
  2. You need to set the permissions on that directory you created so that Wordpress can write to it. This is dependent on how your hosting works and what program you're using, but you should try setting the permissions to e.g. 770, which gives write permission to both the user and group.

I have accidentally deleted the tmp folder from my computer (Macbook) and faced the issue on the localhost WordPress site, and followed the below steps to fix the issue:

  1. First, have to check the temporary folder location by the below code.

    var_dump(sys_get_temp_dir()); In my case, the output was /var/tmp

  2. Then, we have to check if the folder exists or not, by the below code. var_dump(file_exists(sys_get_temp_dir())); In my case, the folder did not exist as I already deleted that.

  3. If the folder does not exist, then create a new folder named tmp. Open the terminal and navigate to the folder /private/var and create a new folder named tmp.

  4. If the issue is not fixed yet, or the folder already exists then we have to check the permissions of the folder.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736253665a142.html

最新回复(0)