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.
Written by The Z Man
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#