Last Updated: February 25, 2016
·
2.547K
· zachthezman

Fix WordPress PCLZIP_ERR_MISSING_FILE

Upgraded to WP 3.5, tried to do an automatic update of a plugin and was immediately hit with an error:

[...] PCLZIP_ERR_MISSING_FILE(-4) [...]

Added the following to my wp_config.php file:

define('WP_TEMP_DIR', ini_get('upload_tmp_dir'));
putenv('TMPDIR=' . ini_get('upload_tmp_dir'));

Fixed.

1 Response
Add your response

I had an issue moving a site from IIS to an apache server so I added a test if the server was IIS then define the temp directory constants

<?php if( stripos( $SERVER['SERVERSOFTWARE'] , 'IIS' ) ){ define('WPTEMPDIR', iniget('uploadtmpdir')); putenv('TMPDIR=' . iniget('uploadtmpdir')); } ?> </code>

over 1 year ago ·