Reputation: 11
Sorry to bug everyone with a possibly newbie question, but I have been struck with a shocking case of the 'Missing Temporary Folder' issue on my Wordpress installation. I have been searching for solutions for a few days now, scouring forums, StackExchange, and all manner of sources. Many of which said to contact my host as it could be a server config issue, which I did who said that he had recreated a 'tmp' folder under the .php directory. Unfortunately, I am still getting the 'Missing Temporary Folder' error.
I've included an image of the path/hierarchy of the folders on my SFTP server, which is running nginX:
I have tried including the line
define('WP_TEMP_DIR', 'DIRECTORY')
(Where DIRECTORY is the address / path to the temp folder in .php) however that didn't fix the issues.
I then tried including
define('WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/')
(Verbatim this time) with the first line of code commented out.
And this code caused an HTTP:// 500 error. If I comment out the above line the site works fine (save for the missing temp folder issue) so it's that code causing the issue, but I'm wondering if the fact that it's causing the 500 error means I'm getting closer (I could just be deluding myself).
Apologies if this is the wrong place, or a stupid question, I'm brand new to Wordpress and PHP, and (aside from this issue) loving it, but I just can't for the life of me seem to solve it!
Upvotes: 1
Views: 3357
Reputation: 1128
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:
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
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.
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.
If the issue is not fixed yet, or the folder already exists then we have to check the permissions of the folder.
Upvotes: 0
Reputation: 63
Create a "temp" folder in your WordPress root directory with 777 permissions. This can be done by your FTP program.
Edit your "php.ini" file
Add the following in php.ini file:
upload_max_filesize = 16M
upload_tmp_dir = on
upload_tmp_dir = /home/username/public_html/wordpressDir/temp
Upvotes: 0
Reputation: 603
Try this link:
if it doesnt help, try taking backup of tmp folder-> delete tmp folder -> recreate. Sometimes, junk data stored in tmp may cause this issue.
Upvotes: 0