skip to Main Content

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


  1. This might happen when you do not have space left on your disk drive. Check this with df -h.

    Login or Signup to reply.
    1. 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)

    2. When you are in wp-content create new folder under wp-content and call it temp.

    3. 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) . ‘/’);

    1. Add following line of code after that line.

    **/Set WordPress temporary directory /
    define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/temp’);

    1. Save the wp-config.php file. If you edited it on your PC upload it to the website
    Login or Signup to reply.
  2. just add define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp'); right after }!
    and create temp folder in wp-content/temp.
    if put cod inside {} won’t work
    somthing like this will work:

     if ( ! defined( 'ABSPATH' ) ) {
        define( 'ABSPATH', __DIR__ . '/' );
    
    }
    define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search