So I am trying to install recommended plugins from a WordPress theme after installing the theme but the plugins installing return errors. Below is the response for contact form 7:
Downloading installation package from
https://downloads.wordpress.org/plugin/contact-form-7.5.2.1.zip…
Unpacking the package… The package could not be installed.
PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file
‘/tmp/contact-form-7.5.2.1-ribBpT.tmp’
I read some inputs about adding some lines of codes into the wp-config file and adding the below and created a folder called "temp" under the contents folder:
/*Set WordPress temporary directory */
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
I then went back to refresh before I tried installing the plugin but the issue remained the same.
Here is what I have in the wp-config file:
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
/*Set WordPress temporary directory */
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
Am I missing anything here? If yes, how do I fix this?
Thanks!
3
Answers
This might happen when you do not have space left on your disk drive. Check this with
df -h
.Go to Your wp-content folder. You can access the wp-content folder by using a file manager on your hosting or using FTP. The location will be domain/wp-content (where domain is the website domain name)
When you are in wp-content create new folder under wp-content and call it temp.
Download your wp-config file from your server to your computer. This is just in case you make a mistake and have a backup which you can quickly restore. Open the wp-config file and search for the following line of code.
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(FILE) . ‘/’);
**/Set WordPress temporary directory /
define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/temp’);
just add
define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
right after}
!and create
temp
folder inwp-content/temp
.if put cod inside
{}
won’t worksomthing like this will work: