WP Plugins or Themes Update error: “Destination directory for file streaming does not exist or is not writable “

Check in wp-config.php which folder is assigned as the temporary directory. the line will start with

  
define('WP_TEMP_DIR', ABSPATH . '/path/to/temp');

Through ftp check the permission on the folder. It should be 755.

Even if all seems alright the update might still failed. In my case my wp-config.php is placed outside the public directory altogether. I decided to go with a temp folder also place outside of the public directoy, those I had to modify my wp-config.php (which is placed in its dedicated directory) as follow:

. I decided to go with a temp folder also place outside of the public directoy, those I had to modify my wp-config.php (which is placed in its dedicated directory) as follow:

define('WP_TEMP_DIR', ABSPATH . '/../temp/');

The path that was causing the error was as follow:

define('WP_TEMP_DIR',dirname(FILE).'/wp-content/uploads');

Placing the wp-config.php outside the public directory allow for an extra layer of security in case the php settings of the apache server get messed up and the php files are exposed instead of being executed. Even though this situation SHOULD NOT happen, there is a possibility that it does and that’s what security is about afterall: being prepared for the unlikely events.

Securing wp-config.php

There is a clear case for moving the file out of the public directory: see the following stackexchange thread https://wordpress.stackexchange.com/questions/58391/is-moving-wp-config-outside-the-web-root-really-beneficial

Just move wp-config.php one level up outside the public directory and wordpress will be able to look for it on its own automatically and you’re all set.

If you have installed several wordpress site in different subdomain, the option might not work for you. In that case, follow the instruction below taken directly from the aforementionned stackexchange thread:

How to move wp-config.php to any location on your server

WordPress will automatically look one directory above your WordPress installation for your wp-config.php file, so if that’s where you’ve moved it, you’re done!

But what if you’ve moved it somewhere else? Easy. Create a new wp-config.php in the WordPress directory with the following code:

<?php

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Location of your WordPress configuration. */
require_once(ABSPATH . '../phpdocs/wp-config.php');

(Be sure to change the above path to the actual path of your relocated wp-config.php file.)

If you run into a problem with open_basedir, just add the new path to the open_basedir directive in your PHP configuration:

open_basedir = "/var/www/vhosts/example.com/httpdocs/;/var/www/vhosts/example.com/phpdocs/;/tmp/"

That’s it!