If you’re trying to install or update a plugin/theme or even updating WordPress core. You might encounter error message(s) like below. These errors could be caused by the temporary directory WordPress uses for any downloads.
Solution To Resolve This is Pretty Simple
- Log in to your hosting control panel or access through FTP to gain access to your website files and directories
- Once you logged in, navigate to the /wp-content folder of your WordPress installation. Create a new directory inside it called temp.
- Now, download /wp-config.php file from your server to your computer and open it in a text-editor. Add the following code at the bottom
/* Set WordPress temporary directory */
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp/') ;
Finally, Save the wp-config.php file. Upload/replace this file to your server.
This should fix the issue. Try updating WordPress or installing a plugin, if for some reason it is still failing, be sure to check file permissions on your
wp-content folder, and make sure it is set to
755 so that the server can write to it. I hope you find this useful!