0

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

enter image description here

2 Answers 2

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.
7
  • I have already tried all this, the line is correct on the specific line, after the comment /* That's all, stop editing! Happy publishing.*/ and i've changed the permissions, but nothing changed, i created 2 folders just in case, one 'temp' the other 'tmp', still not working
    – Hind Dev
    Jul 14, 2020 at 21:09
  • Did you change the permissions on the server? The permissions in your local system probably don't make any difference
    – mozboz
    Jul 14, 2020 at 21:11
  • I posted an image about permissions on the server, i notice that when I change group permissions to write on it doesn't keep it on, but I don't think this is the problem because I'm the only owner who manage the website, no need for group permissions.
    – Hind Dev
    Jul 15, 2020 at 11:11
  • That could be the problem...
    – mozboz
    Jul 15, 2020 at 11:12
  • but the server doesn't keep changes on group permissions, how can I fix that please ?
    – Hind Dev
    Jul 15, 2020 at 11:15
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.