'How do I fix WordPress PCLZIP_ERR_MISSING_FILE (-4) : plugins error?
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!
Solution 1:[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)
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) . '/');
- Add following line of code after that line.
**/Set WordPress temporary directory / define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp');
- Save the wp-config.php file. If you edited it on your PC upload it to the website
Solution 2:[2]
This might happen when you do not have space left on your disk drive. Check this with df -h.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | yommie |
| Solution 2 | Poliakoff |
