PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file ‘/{plugin..}.tmp’ : error in wordpress

PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file ‘/{plugin..}.tmp’ : error in wordpress

How to fix PCLZIP_ERR_MISSING_FILE (-4) Missing file ‘/{somefile.tmp}’ error when updating plugin in WordPress

This solution is based on this WordPress.org thread.

PROBLEM

When you try to update WordPress or install plugins, the downloader / installer page pops up, the compressed file is downloaded to your server, but installation fails because of this error:

PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file ‘C:\Windows\TEMP/{whatever you were installing}.tmp’

SOLUTION

You need to access the files on your server via FTP. If you haven’t done this before, there are tutorials out there. Short version: find the FTP access details for your server, and grab FileZilla FTP Client. Or if your hosting provides a File Manager utility, use that.

On your server, navigate to the /wp-content folder. Create a new folder inside it called TEMP.

Download /wp-config.php from your server to your computer. Open it up in a text editor, and beneath

if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

add the line

define('WP_TEMP_DIR', ABSPATH . 'wp-content/TEMP');

then save wp-config.php. Upload it to your server again.

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

The other solution is not to use Windows hosting!