If you run into problems trying to update WordPress, it could be caused by the temporary directory WordPress uses for downloads. You can easily fix this by defining a WP_TEMP_DIR in your wp-config.php file below.
WordPress update failing
If you’re trying to upgrade WordPress itself, you might encounter this error when trying to update:
Installation Failed
WordPress plugin update failing
If you were trying to update a WordPress plugin, you might have encountered this error instead when updating:
An error occurred while updating (Plugin Name). Download failed. Destination directory for file streaming does not exist or is not writable.
Define a WP_TEMP_DIR in your wp-config.php file
If you’ve encountered issues trying to update WordPress, you can simply follow the steps below to resolve them.
- Open you wp-config.php file with the cPanel File Manager Code Editor
- You should see this code towards the top of the file:
* @package WordPress */ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'anotherd_wrd1');
Place this definition of define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/’); in-between the lines mentioned above, so it ends up looking like this when you’ve completed it:
* @package WordPress */ define('WP_TEMP_DIR', ABSPATH . 'wp-content/'); // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'anotherd_wrd1');
Now Save your wp-config.php file.
- Try to update WordPress again, if for some reason it is still failing, be sure to check file permissions on your wp-content folder, and ensure it’s set to 755 so that the server can write to it.
It worked for me! Thanks.
Hi, I have followed your instructions and I am still getting “Update Failed: Download failed. Internal Server Error” Have you other ways to fix it?
Hello Kevin,
There may be file permissions or other issues causing this. If you are still experiencing that problem, please reach out to our Technical support team at [email protected] so that they can investigate this further.
its workong.tnx
We are glad to see this worked for you!
Thank You! It Works!! been struggling with this for days.
Wow! Thanks! I tried a few things I found out there but your site and support was the only one that worked. Thank you!
That’s great! Glad we could help.
Thank you, this little tip has helped us to transfer a site from one server to another without too much hitch. Great
We’re glad it helped!
Thank you,
John-Paul
Thanks a million, worked like charm
thank you very much. after so much strugle with these for 3days finally i was able to update it successfully
ThankYou so much…its perfact
thank you very much!!!!!!!! it’s useful! you save me! thankyou!!!!
Thanks so much!
Someone just shared this link in our WooCommerce Facebook group:
( https://facebook.com/groups/woohelp )
…and I just wanted to pop in over here and another “fix”.
If, for security measures, you might have read along the way that moving the
wp-config.php
file ‘UP’ one level so that it is no longer in your/public_html
folder, then that will also cause this identical error message to appear.Simply FTP back into the root of your account, move the
wp-config.php
file back to within the/public_html
file again, and you’ll be able to update without the error message.Worked perfectly… Thank you
Thanks heap for that fix!
thank you so much!! Brother
ahaaaa..still i have problem in same line..haaaaaaaaaaaaaaaaaaa
I suggest reaching out to your host.
WOAH, thank you. I was like searching for an hour and I didn’t find anything to fix this problem, and your solution came nicely.
Thank you so much.
Thanks worked for me 🙂
In my site www.example.com I have issude with this error
RSS Error: WP HTTP Error: Failed to connect to wordpress.org port 80: Connection timed out.
I tried to change update.php file back to 4.0 version still, not able to solve.
Cant install any Plugin. Can anyone check my site and can solve problem..
Hello admin,
Thank you for contacting us. I recommend following our WordPress Troubleshooting guide to narrow down the cause.
Thank you,
John-Paul
Legend! thanks man
Excellent! This worked a treat, so thank you!
Hi All, I’m receiving this error everytime I update my wordpress or even plugins…
Have you ever encountered this problem?
Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)
Please help me 🙁
Sounds like you need to manually update WordPress. Here’s a link to the WordPress Forums that may help you understand the issue further.
thanks it helped me alot
Download failed.: There are no HTTP transports available which can complete the requested request.
Installation Failed
If this kind of error when upgrade wordpress you know why?
Hello Nurul,
This error has been reported in the WordPress support forum. One of the developers has answered the question based on different configurations. Please review is his posts for more details and possible resolutions for your error.
Regards,
Arnel C.
GREAT … thanks for your help. Quick and easy to fix !!!
Much appreciated !!!
Thanks, big help!
Thanks — this is the only thing that worked out of all the things I tried.
Worked like a charm. Thanks
Thanks a million time for this wonderful help.
Doesn’t work for me. Has anything changed since this fix was added?
After I add define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/’); to the wp-config file, should I see a temp file somewhere? I don’t.
Hello Isak,
To our knowledge this should still work. Are you getting any particular error message?
Kindest Regards,
Scott M
Thanks a lot, for giving me best and easy solution. I was trying to recover from this problem past 2 days, after reading your instruction, i followed the same and finally i am out of the problem. Again a big thanks
What if you have this ?
Could not resolve host: downloads.wordpress.org
Installation failed.
It appears that something is blocking the connection to WordPress. Is this hosted with us? If so, you may contact live support for further assistance.
thank you.
Hi I am having the same problem, I can’t update wordpress or my plugins, or upload photos to my posts – I tried your solution and it didn’t resolve the problem for me, unfortunately. I’m wondering is the configure file Daphen mentioned is the wpconfigure or a different one located somewhere else? Thanks for your help!
Hello Carter Adopt,
Sorry for the continued problems with WordPress. Yes, the “config.php” references “wp-config.php” which is located in the root of your WordPress installation. If you continue to have the problem, please provide us more information on your account. Give us your URL or customer ID (if you are an IMH customer) and we would happy to look further into the problem.
Regards,
Arnel C.
Thanks. This solved my issue with opdating i plugins, but – unfortunately – not the uploading of images. But I fearthere may be some overall php-settings that needs to be fixed in my case.
Thank you Daphne. You saved my day.
Hello
It sorts it out. Thank you 😉
Hi Scot,
Yes ofcourse!
What resolved the issue for me was removing: “DEFINE(‘WP_TEMP_DIR’, ABSPATH . ‘/PUBLIC/TMP’)” in the config.php file.
After that I could update all my plugins again!
Kind regards,
Daphne
Hello Daphne,
Thank you very much for the share! We will be sure to pass that info on.
Kindest Regards,
Scott M
Hi Jacob,
I posted a question earlier today but it’s not showing here.
But in case you did receive this question…I resolved it so please ignore that post 😉
Thanks,
Daphne
Hello Daphne,
Yes, the questions will not display unless they are approved due to lots of spammers. However, we are glad to hear you were able to resolve the issue. If you would not mind sharing how you did it, it may be helpful for others who run into the same situation.
Kindest Regards,
Scott M
Hi Jacob,
For me this sollution is still not working.
I have also put this problem up on the wordpress forum but still no luck.
Do you have any other ideas what could be wrong?
I have the: define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/’);
as follow: define( ‘WP_TEMP_DIR’, ABSPATH . ‘/public/tmp’) ;
in my config.php
My tmp folder is in my public-folder
Everything is set to 755
Hope you can help me out.
Thanks,
Daphne
follow the instructions above then Kindly remove this the last line in wp-config.php file, it worked for me
define(‘WP_TEMP_DIR’, dirname(__FILE__) . ‘/wp-content/temp/’);
Great Fix. 😛
It worked ! thanks
Thanks for the help. Perhaps the text on the website could have a bit more whitespace around it as it is a tiny bit cramped. Great site. Thanks!
Hey Nick, thanks a lot for commenting!
This is one of my guides that hasn’t been updated for quite some time, and Google Analytics doesn’t give me human input about styling. So I really appreciate your observations for hopefully making this content easier to read for another person down the road!
Please take another look at the guide if you can, and let me know if you have any other recommendations!
Thanks again 🙂
– Jacob
Fixed! Thanks heaps Jacob
This fixed my issue. Thanks a lot!
Awesome!
This worked perfect in my update to 3.9.
Thanks a lot!
Woah, thank you so much!!
No problem Daniel, glad it helped! 🙂