PCLZIP_ERR_MISSING_FILE (-4): Missing archive file

You may encounter this error when you try to update WordPress or install plugins. Yes, you may see the installer page, and also the zip file may be downloaded to your Cpanel, but then during installation, you run into an error; PCLZIP_ERR_MISSING_FILE (-4): Missing archive file … tmp’

SOLUTION
To fix this, you need to create a tmp folder, then define its location in the wp-config.php file. Below are the steps
1. Log into your server, either via Control panel or FTP so that you can have access to your website files.
2. Navigate to the directory where you installed your WordPress. In the Cpanel, that would be File Manager->public_html.

However, if you are working on an addon domain in Cpanel, then this folder will be the root directory for the addon domain. In Cpanel, it is likely to be a folder with the same name as that domain, and by default, it will be located under File Manager. If you defined a custom root directory for your domain, then please navigate to that directory.

3. Once there, you will see WordPress files. Open the wp-content folder. Inside wp-content, create another folder called tmp or temp. You can give it any of those names.

4. Right-click on the tmp or temp folder, and then click on change permissions.
5. Check all the boxes s that the folder has permissions of 777, thus writable.

6. Now go a step back, outside of wp-content, then locate the wp-config.php file, which is found inside the directory where you installed WordPress.
7. Open right-click the wp-config.php file, then click to edit it.

8.  Scroll down to the line that has this code “if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . ‘/’);”

9. Below that line, put this code, depending on whether you created a tmp folder or temp folder in step 3 above, save the file
“define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/tmp’);”
OR
“define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/temp’);”

10. Try updating WordPress or installing a plugin. It should work now.

Below ia a video discription of the steps above.

Was this article helpful?

Leave A Comment?